Questions tagged as 'shell-script'

2
answers

Unpacking files with space in the name

I'm trying to unpack a large mass of files in linux and I'm trying to use a for that looks like this: for z in *.zip; do unzip $z ; done but I get the following message:    unzip: can not find or open divide, divide.zip, or divide.ZIP. u...
asked by 21.06.2016 / 17:07
1
answer

Print array value in bash by PHP shell_exec

I have another script, but I simplified it to simulate the problem that persists. test.sh #!/bin/bash ARRAY=('like' 'a' 'stone') echo ${ARRAY[0]} In the file below, I have already made sure that shell_exec is actually executing...
asked by 31.07.2016 / 21:16
1
answer

How to make a find in GNU Linux bring some files and ignore others [closed]

How to make a find in GNU Linux bring all files of a folder, ignoring the files of a specific subdirectory.     
asked by 28.10.2014 / 01:25
2
answers

How to execute create mysql database using shell script if base name has "-"

On the server there are some databases named modelo-submodelo (this is the name of the database, created with "-" same). When I execute a command like: mysqldump -h"$DBHOST" -u"$DBUSER" -p"$DBPASS" modelo-submodelo --compress=TRUE &g...
asked by 29.03.2017 / 15:30
1
answer

Backup and deploy with shell script

I have a productive environment for which I upload html, css etc. files. However, every time I upload a file I must first back up existing instances. I'm trying to build a script that does the following: Read the upload directory and se...
asked by 11.10.2016 / 18:04
1
answer

How to create initialization script in Debian by modifying environment variables

I need to create a startup script that modifies the resolution that Debian sets by default. I currently have the following shell script that does the work: export XAUTHORITY=/home/giuliana/.Xauthority xrandr --newmode "1368x768" 85.25 1368 144...
asked by 10.09.2016 / 19:06
1
answer

Wrong ping response

Considering that ${parameters} is an array that can contain valid IP addresses or not, I wrote the following code: for ((i=0; i<$#; i++)); do eval "arg=\${$i}" ping ${parameters[i]} -c1 -q &>/dev/null...
asked by 19.09.2016 / 05:19
1
answer

Pass data captured from a Python code to Shell Script

I would like to know what to do to get this data from a DHT11 sensor (Python Code [Temperature and Humidity]) and pass it to a script in Shell if umid is not None and temp is not None: print("Temperatura = {0:0.1f}Umidade{1:0.1f}\n").form...
asked by 20.10.2016 / 04:20
2
answers

Convert File Names To Alphabet Letters

Convert File Names To Alphabet Letters For example , I have several image / photo files in a directory, and I want to pass these long names of their images into names designated by the letters of the alphabet Before IMG01-03082016.j...
asked by 21.08.2016 / 17:29
2
answers

Handle Date with Date command

Expensive; I have a very simple problem, but I can not find a logic for this. I have a file with fixed dates, example 2017-10-31, I would like every month change, this date would be added with the current month. At the top date is month 10 (O...
asked by 26.10.2017 / 23:01