Passing flags as stdin into a bash script
Posted on 2009-07-14
I am familiar with passing stdin into a shell script the traditional way:
Variable $1 will be passed to the script.
What I would like to do is pass multiple values per variable I pass in, using flags or another method that someone might recommend:
shell>./dothis.bash -d database1 database2 database3 -p 3306
Where -d will pass database1,database2, and database3 to the script as an array or something. The number of arguments might be different each time.
Anyone know how to accomplish something like this?