Questions tagged [bash] (1109)

1
answer

Why it works if in bash?

Good day, there's a simple script NAME=$1 FORMAT=$2 INPUT_FILE=$3 DATA=$(date "+%Y-%m-%d") ARHIVE_NAME=$(echo $NAME is$DATA.$FORMAT) # tar or zip if [[ "$FORMAT"=="tar" ]]; then tar cf $ARHIVE_NAME $INPUT_FILE echo "tar successfully" elif [[ "$FORMAT"=="zip" ]]; then zip $ARHIVE_NAME $INPUT_FILE echo "successfully zi...
kraig.Miller asked April 19th 20 at 12:43
1
answer

How to parse this log?

Hello. Help to parse log Is the status log from openVPN like this. ivanov.as IP_addres,56924339,46404603,Thu Apr 16 07:20:32 2020 petrov.da,IP_addres,26209226,320310272,Thu Apr 16 07:48:03 2020 robt.mv IP_addres,341887484,1000952454,Thu Apr 16 08:08:04 2020 Bash or regular expressions need to read the end-user for exampl...
miller asked April 19th 20 at 12:24
1
answer

How to record logs of ffmpeg to a file?

fmpeg code outside the bash script works perfectly. For some reason when trying to write logs to a file using 2> - complains Unable to find a suitable output format for '2>' I have the feeling that the system treats this as a command ffmpeg #!/bin/bash cmd="ffmpeg -re -i "xx.m3u8" -c:v copy-c:a aac-b:a 128k -ac 2 -s...
elmo46 asked April 19th 20 at 12:19
2
answers

As it is easier and faster to parse this file?

Good day, tell me what is the easiest way to steam this file in bash xxx:[<b>yyyyy1</b>] yyy:[xxxx] xxx:[<b>yyyyy2</b>] yyy:[xxxx] .... In a result, you need to : yyyyy1 yyyyy2
ally.Macejkovic54 asked April 19th 20 at 12:11
1
answer

Why in crontab does not run the shell script?

There is a script: #!/bin/bash CHECK='server-release is not running ... failed!' #test string STATUS=$(/home/user/server/server/build.sh status) #write the status of the server in a variable if [ "$CHECK" == "$STATUS" ] then echo "server is stopped" rm-f /home/user/server/server/server.pid /home/user/server/server/build...
Kaya asked April 19th 20 at 12:09
1
answer

Why `complete ' docker` is not defined, but docker auto-completion in bash works?

As far as I know, bash defines the rules for auto-completion on the basis of the bash completion, basic rules which are stored in /etc/bash_completion.d. I have there are: apport_completion darcs docker-compose grub apt-linux mint dkms git-prompt As can be seen, among them there is a docker-compose. Check: $ complete-p dock...
nya_McClure asked April 19th 20 at 11:55
3
answers

As in bash-e to parse the html page?

Good afternoon, prompt please, a cycle through a list of URLS where the content (html source code) download. The problem is that you need to get a certain piece of text which is in a certain konteineriem, for example <div class="text-container"> <p>Need a paragraph</p> <p>Again, need some paragrap...
cole_Hilpert asked April 18th 20 at 13:38
1
answer

Backup or bash setup script macOS?

Hi. Have 3 Mac's, periodically you have to reinstall your system from scratch. Backups Mac do not. All data in iCloud automatically podtyagivatsya on all Macs. And soft I love to configure and download the new. The question is, is it possible to make a backup of the settings only Mac, no files, etc? Or tell me where to ...
Stanley_Hackett70 asked April 18th 20 at 13:08
4
answers

What software to choose to manage the start-up scripts?

Situation: there are a few dozen python scripts, part work, part require manual run with constant parameters. Perfect mechanics: Go to web page on there to look at the list of scripts and their status (running/not running) started off as the "stop" button, not start button "start". Something like the airflow but much easie...
Alena.Kuvali asked April 18th 20 at 12:52
1
answer

My first bash script -error-varname command not found?

wrote my first bash script, but there is an error - varname command not found ' line 9 #!/bin/bash echo 'please provide disk name' read varname sudo file-s /dev/$varname if [ "$(sudo file-s /dev/$varname)" = "/dev/$varname: data" ]; then sudo mkfs -t ext4 /dev/$varname sudo mkdir /mnt/$varname sudo mount /dev/$varnam...
nico asked April 18th 20 at 12:26