a bash scripting question

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I also recall in a Howto that I looked at a statement to the effect that
bash variables were typeless. That's esentially what Damien pointed out.

On Thu, 7 Aug 2003, Michael Damien Curran wrote:

> 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
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE/MY89GT7f58lCbH0RAjVBAJ9J3r8RrPTudGNjOh/LdE/n5nPMXgCbBsMg
YaZ34EwEozeJqA/6oqyaNOQ=
=PlB6
-----END PGP SIGNATURE-----






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