[Linux-Discussion] Re: what does the variable $1 mean in Bourne shell?

  • From: Adrian Corbuleanu <acorbuleanu@xxxxxxxxxxxxx>
  • To: linux-discussion@xxxxxxxxxxxxx
  • Date: Tue, 18 Dec 2001 17:24:03 -0600

> I know what the variable $# means in Bourne shell
>
> what does $1 mean?
>
> thanks
> David

It's the first argument in the command line. I.e.:

You can do write a script called "myifconfig"

ifconfig eth0 $1 netmask $2

Then chmod u+x myifconfig and run

#./myifconfig 192.168.1.1  255.255.255.0

The last line will be equivalent to

#ifconfig eth0  192.168.1.1 netmask 255.255.255.0

Regards,

--
Adrian Corbuleanu
Astrocom Corp- Engineering
763-694-6462


Other related posts: