a bash scripting question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Simply just use the variables $1 and $2.
In bash there is no difference between integers and strings.
Just for interest sake, $0 is the file name of the script ... how it was
called.
e.g.
AddTwoNumbers 3 4
$0 has a value of "AddTwoNumbers"
$1 contains 3
and $2 contains 4
Hope this helps
Mick

On Wed, Aug 06, 2003 at 05:24:32PM -0500, Gregory Nowak wrote:
> Hi all.
> 
> Can someone please tell me how to write a bash script that would accept 2
> arguments from the command line, where the first argument would be an
> integer like 1234567, and the second argument would be a text string?
> I would then like to be able to access the variables inside the script
> via $VAR1 and $VAR2.
> 
> Thanks for any help.
> 
> Greg
> 
> 
> -- 
> Free domains: http://www.eu.org/ or mail dns-manager at EU.org
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 

-- 
---
Michael D. Curran
WWW: http://redgum.bendigo.latrobe.edu.au/~mdcurran/
Email: mick at jantrid.net
MSN: mick at jantrid.net
AOL: manchi2003
Yahoo: manchi20032000
ICQ UIN: 113763334




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux