There are several options but this one will work (Assuming bash or sh):
if [ "$2" == "" ]; then
Also, here is a very handy guide I use for those quick lookups when you
get rusty. It is avail. in PDF and HTML.
http://personal.riverusers.com/~thegrendel/abs-guide-1.6.tar.bz2
-Chuck
MET wrote
Thanks a lot that worked =)
~ Matthew
-Original Message-
From: [EMAIL PROTECTED] [mailto:redhat-list-admin@;redhat.com]
On Behalf Of Cowles, Steve
Sent: Tuesday, November 05, 2002 10:49 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Shell Script Question || Check for se
> -Original Message-
> From: MET
> Subject: Re: Shell Script Question || Check for set variable
>
>
> I've tried what follows and I still get " if: Expression Syntax ".
>
>
> #!/bin/tcsh
>
> if [ -z "$2" ]
I've tried what follows and I still get " if: Expression Syntax ".
#!/bin/tcsh
if [ -z "$2" ] ; then
echo You have not set a file to be appended.
exit 1
fi
Any ideas?
~ MET
On Tuesday 05 November 2002 7:35 pm, Todd A. Jacobs wro
On Tue, 5 Nov 2002, MET wrote:
> if ( ! $2 ) then
> echo You must set a second file
> exit 1
> fi
Start by reading the bash manual at:
http://www.gnu.org/manual/bash-2.05a/bashref.html
But you can do a test expression like:
if [[ -z $2 ]]
On Tuesday 05 November 2002 06:54 pm, Hal Burgiss wrote:
> On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote:
> > Simply put, I'm trying to check if $2 is set. Any ideas?
> >
> > if ( ! $2 ) then
> > echo You must set a second file
> > exit 1
> > fi
> >
> > The ab
On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote:
> Simply put, I'm trying to check if $2 is set. Any ideas?
>
> if ( ! $2 ) then
> echo You must set a second file
> exit 1
> fi
>
> The above doesn't work reporting if expression error. Any help would b
Simply put, I'm trying to check if $2 is set. Any ideas?
if ( ! $2 ) then
echo You must set a second file
exit 1
fi
The above doesn't work reporting if expression error. Any help would be
greatly appreciated.
Thanks in advance,
~ MET
--
redh