Possible Duplicate:
How do I handle switches in a shell script?
Most common shell commands allow the user to specify options in any random order. Positional Parameters like $1 as commonly used in bash (I tend to write all my scripts in Bash but I don't think this question is actually Bash specific) scripts on the other hand, are order specific.
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]=
I've learnt the basics of programming in bash.
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.
I'm looking to switch from bash to zsh but concerned about compatibility of bash scripts.
Are all bash scripts/functions compatible with zsh? Therefore, if that is true is zsh just an enhancement to bash?
I'm probably doing something remarkably stupid, but I can't figure out what.
Running Ubuntu Server 12.04 on a cloud host (Digital Ocean, if it matters).
TweetAt times when you install daemons they do not come with initialization scripts. Bash provides a way to create a simple script to initialize the daemon, in other words an easy way to start stop...
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 am refining a bash/yad script which runs when an event reminder is triggered in KOrganizer. (yad is a drop-in replacement for zenity.