Linux Newbie help
 help / color / mirror / Atom feed
* Passing the entire command line
@ 2002-11-16  3:05 Adam Luchjenbroers
  2002-11-16  3:13 ` Mike Dresser
  2002-11-18 15:41 ` hackob
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Luchjenbroers @ 2002-11-16  3:05 UTC (permalink / raw)
  To: linux-newbie


While bash can retrieve the different commandline values using the variables 
$1, $2, $3, etc - is there a way to just read out them all at once (with 
spaces between the values).

I use startup scripts for many of my games, and I want the script to pass 
through command line options at the end (for connecting to servers, etc).

-- 
Linux...
"Find out what you've been missing while you've been rebooting Windows NT." 
-Infoworld

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Passing the entire command line
  2002-11-16  3:05 Passing the entire command line Adam Luchjenbroers
@ 2002-11-16  3:13 ` Mike Dresser
  2002-11-18 15:41 ` hackob
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Dresser @ 2002-11-16  3:13 UTC (permalink / raw)
  To: Adam Luchjenbroers; +Cc: linux-newbie



On Sat, 16 Nov 2002, Adam Luchjenbroers wrote:

>
> While bash can retrieve the different commandline values using the variables
> $1, $2, $3, etc - is there a way to just read out them all at once (with
> spaces between the values).
>
> I use startup scripts for many of my games, and I want the script to pass
> through command line options at the end (for connecting to servers, etc).

mdresser@router:~$ cat testingforadam
echo $*
mdresser@router:~$ ./testingforadam hello adam how are you today
hello adam how are you today

=)

Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Passing the entire command line
  2002-11-16  3:05 Passing the entire command line Adam Luchjenbroers
  2002-11-16  3:13 ` Mike Dresser
@ 2002-11-18 15:41 ` hackob
  2002-11-18 17:21   ` James Mohr
  1 sibling, 1 reply; 4+ messages in thread
From: hackob @ 2002-11-18 15:41 UTC (permalink / raw)
  To: linux-newbie

Put them between ""

----- Original Message -----
From: "Adam Luchjenbroers" <Adam@Luchjenbroers.com>
To: <linux-newbie@vger.kernel.org>
Sent: Friday, November 15, 2002 9:05 PM
Subject: Passing the entire command line


>
> While bash can retrieve the different commandline values using the
variables
> $1, $2, $3, etc - is there a way to just read out them all at once (with
> spaces between the values).
>
> I use startup scripts for many of my games, and I want the script to pass
> through command line options at the end (for connecting to servers, etc).
>
> --
> Linux...
> "Find out what you've been missing while you've been rebooting Windows
NT."
> -Infoworld
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Passing the entire command line
  2002-11-18 15:41 ` hackob
@ 2002-11-18 17:21   ` James Mohr
  0 siblings, 0 replies; 4+ messages in thread
From: James Mohr @ 2002-11-18 17:21 UTC (permalink / raw)
  To: linux-newbie

> ----- Original Message -----
> From: "Adam Luchjenbroers" <Adam@Luchjenbroers.com>
> To: <linux-newbie@vger.kernel.org>
> Sent: Friday, November 15, 2002 9:05 PM
> Subject: Passing the entire command line
>
> > While bash can retrieve the different commandline values using the
>
> variables
>
> > $1, $2, $3, etc - is there a way to just read out them all at once (with
> > spaces between the values).
> >
> > I use startup scripts for many of my games, and I want the script to pass
> > through command line options at the end (for connecting to servers, etc).

The special variable $* (dollar-sign asterisk) contains ALL of the positional 
parameters, regardless of how many they are. This is obiviously useful when 
you do not know how many variables will be passed. The variable $0 stands for 
the actual command. More details can be found here:

http://www.linux-tutorial.info/cgi-bin/display.pl?33&0&0&0&3

Regards,

jimmo

-- 
---------------------------------------
"Be more concerned with your character than with your reputation. Your
character is what you really are while your reputation is merely what others
think you are." -- John Wooden
---------------------------------------
Be sure to visit the Linux Tutorial:  http://www.linux-tutorial.info
---------------------------------------
NOTE: All messages sent to me in response to my posts to newsgroups, mailing 
lists or forums are subject to reposting.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-18 17:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-16  3:05 Passing the entire command line Adam Luchjenbroers
2002-11-16  3:13 ` Mike Dresser
2002-11-18 15:41 ` hackob
2002-11-18 17:21   ` James Mohr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox