bug-bash
[Top][All Lists]
Advanced

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

Re: Variable getopts lost


From: Mart Frauenlob
Subject: Re: Variable getopts lost
Date: Tue, 23 Feb 2010 22:45:10 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

On 23.02.2010 20:55, Daniel Bunzendahl wrote:
> Am Dienstag, 23. Februar 2010 20:45:31 schrieb Greg Wooledge:
>> On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote:
>>> if [ !$LSEITE ]; then
>>
>> You want:  if [ ! "$LSEITE" ]
> 
> this dosn't work.
> 
> But I earsed the if-loop. And it works. (dont overwrite LSEITE)
> But I need this check in case somebody will put last page to work with...
> 
> maybe I try thinks like
> 
> test .... 
> 
> If I don't find a way, I will ask again.
> Thanks for your time :-)
> 
> Gratings
> Daniel
> 
>> There are probably more errors.  This is just the line you mentioned
>> in particular as not working.
>>
> 

use the '[[' conditional command. you don't need to quote the variables
with it.

if [[ ! $var ]]; then ...

if ! [[ $var ]]; then ...

if [[ -z $var ]]; then ...

if [[ ! -n $var ]]; then ...

if ! [[ -n $var ]]; then ...

Best regards

Mart


reply via email to

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