[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Variable getopts lost
From:       Mart Frauenlob <mart.frauenlob () chello ! at>
Date:       2010-02-23 21:45:10
Message-ID: 172f1$4b844cb7$3eb2731b$25627 () news ! chello ! at
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic