I have a set of directories listed inside a text file as
DIR_A= (name of directory 1)
DIR_B= (name of directory 2)
....
I have a second script to which I would like to pass an argument like sh Scriptname varname where varname could be A, B, ...
Scriptname sources the initial text file and I would like this script to accept the passed varname (using $1) to echo DIR_varname.
Any ideas? TIA
=and the name, that would directly trigger a bug. Make sure your examples fit the same form as your real data.bashtag, but you're saying that your script is being run withsh. These are very different shells -- if you want to use bash-only features, your script must be run withbash scriptname, notsh scriptname. If you want help writing a script that runs withsh, tag the questionsh, notbash.