Re: passing arguments with getopts
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Thu, 29 Mar 2007 16:46:35 -0400
On 2007-03-29, Seb wrote:
On Thu, 29 Mar 2007 18:48:44 GMT,
Seb <spluque@xxxxxxxxx> wrote:
[...]
How can I test later for the existence of VAR2 and pass this to the
external function? I tried:
if [ $VAR2 ] ; then
[...]
Never mind, $VAR2 needed to be double-quoted above.
Safer is to use -n:
if [ -n "$VAR2" ] ; then
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- References:
- passing arguments with getopts
- From: Seb
- Re: passing arguments with getopts
- From: Seb
- passing arguments with getopts
- Prev by Date: Re: What Will This Return?
- Next by Date: FREE Linux Shell Provider
- Previous by thread: Re: passing arguments with getopts
- Next by thread: Re: passing arguments with getopts
- Index(es):