Questions tagged as 'bash'

0
answers

syntax error near unexpected token 'fi' [closed]

I'm new and I'm having problems with the script below: echo "Enter an A, B or C" read letter if [[ $letter == "A" || $letter == "a" ]]; then echo "this is A" elif [[ $input == "B" || $input == "b" ]; then echo "this is B" elif...
asked by 09.12.2017 / 05:32
3
answers

Run MySQL command when booting the system

Other commands I was able to execute when booting the OS normally in these two ways: 1 - Creating a .sh file in the /etc/init.d/ folder and putting the command in. 2 - Placing at the end of file /etc/rc.local before...
asked by 22.09.2017 / 19:50
1
answer

How to generate list of directories and execute actions for each item in the list?

I'm trying to build a Shell Script that stores the directories that exist in the / Volumes root and perform an iteration over these, ignoring only the directory: "Preboot" and "Macintosh H"     
asked by 30.09.2017 / 00:10
1
answer

Every round loop exchange var

I'm developing a shell system that has a form for adding some fields. Product Quantity Unit Value etc ... I need every time I loop the loop to change a variable, so I call it on the form! In case it is prev, every round it switches to p...
asked by 26.09.2017 / 19:03
0
answers

Linux script to send e-mail from the result of the find command [closed]

I need a help in a script to send a result by email from a search (find) and run every day at 08:00 without using contrab in linux     
asked by 13.06.2017 / 14:49
1
answer

Redirect the standard HCIDUMP output using GREP to a file

I'm using a shell script to do HCIDUMP and using some filters to write to a file. With the following command, the destination file is empty. hcidump -a l2cap | grep -v -e 'CAP' -e 'HCI' > onlystringsrecieved.txt Using the same command wi...
asked by 26.03.2017 / 05:48
1
answer

How to make conditional receive a parameter followed by an argument

I've been trying to create a if..else structure with a passing parameter. See: Example $ opt-get -i pacote.tgz    This, I'm creating something similar to the apt-get tool of the Debian Operating System . I have made...
asked by 03.12.2016 / 23:22
1
answer

Rename child directories and directories

I'd like to know how a bash code is made to rename all files of a certain extent and folders that begin with an expecific name. The repository that I want to make changes to: link For example: 1.in - > 01.in 1.out - > 01.out...
asked by 06.10.2016 / 15:51
1
answer

enter bash commands no expect

Good evening guys, I have an activity to do that needed me to use Expect to remove the user interaction in an SMTP communication. So in the body of the email I need to add the current date and size of a file. the code is like this #!/usr/bin/e...
asked by 28.08.2016 / 05:31
2
answers

Is there any error in these command lines? [closed]

I am making comparisons between documents through Bash command lines and using a loop command. However, an error occurs with the results: ./anibatch.sh: line 38: ./ANIcalculator: No such file or directory ./anibatch.sh: line 39: ./ANIcalculat...
asked by 10.10.2016 / 19:48