Scripting Question:

Garrett Klein kleins at iquest.net
Fri Aug 26 18:10:19 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Steve,

	Try this.
#!/bin/bash
echo -e $# arguments passed
echo -e "$*"

HTH.

Garrett

On Thu, Aug 25, 2005 at 12:20:09PM -0600, Dawes, Stephen wrote:
> Kirk,
> 
> When I tried your solution, I get echo'ed what has been passed to the
> script. However, I don't know how arguments were passed to the script at
> this point.
> trythis 1 2 3 4 5
> returns:
> 1 2 3 4 5
> 
> This is what I passed to the script, but it doesn't tell me that I
> passed 5 parameters to the script.
> 
> Is there a simple way to get this information, or am I going to have to
> parse the string $* to determine how many words are on it. 
> 
> Kirk, a second question stemming from your response:
> KR: It is very simple you just $* instead of $0.  If you enclose it in
> quotes you will also get arguments which are meant to be together.
> Does this mean that if I put something like 
> -l logfilename
> that these 2 words would bee seen as one parameter?
> 
> Do you have a script example that I could look at?
> 
> Steve Dawes
> Phone: (403) 268-5527
> Email: SDawes at calgary.ca
>  
>  
> 
> 
> NOTICE -
> This communication is intended ONLY for the use of the person or entity named above and may contain information that is confidential or legally privileged. If you are not the intended recipient named above or a person responsible for delivering messages or communications to the intended recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying of this communication or any of the information contained in it is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and then destroy or delete this communication, or return it to us by mail if requested by us. The City of Calgary thanks you for your attention and cooperation.
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDD5NLpyN96jH+4g0RA1BMAJ92i6Rz4Tj6ybg4eeCTHm5BpxqKEgCfZFmE
F3V1zP2HMVRPqH9FEG5zOnk=
=NW12
-----END PGP SIGNATURE-----




More information about the Speakup mailing list