Bash scripting

Bryce C plug-discuss@lists.plug.phoenix.az.us
Mon, 29 Jul 2002 13:29:33 MST


It moves the second parameter passed to the first's variable if there was a match.  I don't want to be tied down to a certain set/order of the parameters.  I'm simply trying to move/rename $2 to $1 which is very difficult because a variable name can't be number.
Hope that helps.



Eddie Williams <droog@zeroday.net> wrote :

> Hmmm, im not sure what youre trying to do, but I use this reference
> alot...
> 
> http://www.tldp.org/LDP/abs/html/
> 
> 
> On 29 Jul 2002, Bryce C wrote:
> 
> > Can anyone tell me how, in a bash script, I can move the contents of
> > variable $2 to variable $1 and so on?  I'm writing a bash script to
> > update some stuff but I'd like to be able to type
> > script.sh noblah noit nothat
> > but everything is defaulted yes.
> > Currently., my script is something like
> > case "$1" in
> > 	noblah)
> > 		echo Not doing blah.
> > 		$1="$2"
> > 	;;
> > 	*)
> > 		echo Doing blah;
> > 	;;
> > esac
> > case "$1" in
> > 	nothis)
> > 		echo Not doing this.
> > 		$1="$2"
> > 	;;
> > 	*)
> > 		echo Doing this
> > 	;;
> > esac
> >
> > That sort of thing.  Can anyone help?  Perhaps a nice online reference?
> > No books though, I don't have the money or time to buy one.
> >
> > Thanks,
> >
> 
> -- 
> 
> 
> -Eddie
> 
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail
> doesn't post to the list quickly and you use Netscape to write mail.
> 
> PLUG-discuss mailing list  -  PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Bryce C.
Network Administrator
CoBryce Communications
Bryce@BryceCo.Net
http://www.BryceCo.Net