I've learnt the basics of programming in bash.
I am writing a bash script to run test some scripts.
The names scripts of the scripts to tests are stored in an array.
Code:
scptArr[1]='chcksfrd.bash'
scptArr[2]='compute-misfit.bash'
scptArr[3]='compute-travel-times.bash'
scptArr[4]='create-data-tinv.bash'
scptArr[5]='create-docs.bash'
scptArr[6]='create-model.bash'
scptArr[7]='darwin-ga.bash'
scptArr[8]='listdir.bash'
scptArr[9]=
How can I find out whether a script is written in bash or sh?
The first line of the script is not helpful here, since on Linux, bash scripts have this line:
#!bin/sh
Actually, there are many distribution where bin/sh is bash (maybe bin/sh is a link to bin/bash in those distributions), and not Bourne Shell.
I have a server that I've setup running PHP. This serves JSON files and is running fine.
I also have several scripts that reads data from an outside source, connects to my MySQL Database Server, and runs commands to save the data to the MySQL Server.
Currently I am using Bash Scripts that are executed via Cron.
After upgrading to a new release version, my bash scripts start spitting errors:
bash: /dev/stderr: Permission denied
in previous versions Bash would internally recognize those file names (which is why this question is not a duplicate of this one) and do the right thing (tm), however, this has stopped working now.
If you want to add a dash of GUI goodness to your Bash scripts, you have several options. You can use Zenity or Kdialog to quickly add simple dialogs and message boxes to Bash scripts. However, both tools are rather limited, and for a more complex GUI design you might want to give YAD a try.
My lab uses csh scripts to run jobs. It is usually difficult for me to debug a shell script, so I'm wondering if there is a csh debugger I can use.
I know there are some flags like -x or -v that can help, but because the script is kind of long, it would be better if I can set breakpoints on it.
I am looking for a script that will execute all of the bash scripts in a given directory in the order by which they were added.
In a Bash script I used getopts command to let a user does something regards to the selected options.