LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Andrew Lord <andrewlord@internode.on.net>
  To  : <linuxsa@linuxsa.org.au>
  Date: Mon, 28 Jul 2003 01:07:30 +0930

Re: bash & yank

Thanks David,

Little ripper!

Cheers,

Andrew Lord

On Mon, 28 Jul 2003 12:54 am, you wrote:
> Andrew Lord <andrewlord@internode.on.net> wrote:
> > Under bash, if I do:
> > date
> > day=yank-2th-arg
> > month=yank-1th-arg
> > year=yank-5th-arg
> > echo "This is the day $day"
> > echo "This is the month $month"
> > echo "This is the year $year"
> >  . . . then I just get  . ..
> > 	This is the day yank-2th-arg
> > 	This is the month yank-1th-arg
> > 	This is the year yank-5th-arg
>
> I'd certainy hope so.  Bash has no yank command like that.
> One way to do what you want is to set the output of your
> command as shell argument variables, using the set command:
>
> 	set -- `date`
>
> Then you can use $1, $2, and so on.
>
> 	echo "This is the day $1"
> 	echo "This is the month $2"
> 	echo This is the year $6

-- 
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page