[Top][All Lists]

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

Re: how do I do $*:q in bash shell

From: Botao Lee
Subject: Re: how do I do $*:q in bash shell
Date: Fri, 18 Jun 2004 09:27:52 -0700

thanks, it solved the problem. ---Botao

At 08:13 PM 6/17/2004 -0400, Chris F.A. Johnson wrote:
On Thu, 17 Jun 2004, botao wrote:


I have a tcsh script which has

   exec $tool $*:q

I am trying to convert this into bash shell as

   exec $tool $@

It does not work in some cases, ie

   <script>   "first arguemnt" "second argument"

in csh, $tool gets 2 argument; in bash $tool get 4 argument.

Can somebody help me on this?

     Use "$@".

man bash:

   Special Parameters
       The  shell  treats  several parameters specially.  These parameters may
       only be referenced; assignment to them is not allowed.
       @      Expands  to  the positional parameters, starting from one.  When
              the  expansion  occurs  within  double  quotes,  each  parameter
              expands to a separate word.  That is, "$@" is equivalent to "$1"
              "$2" ...

        Chris F.A. Johnson                      http://cfaj.freeshell.org
                Everything in moderation -- including moderation

reply via email to

[Prev in Thread] Current Thread [Next in Thread]