On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote:
> ...
> if [ !$LSEITE ]; then 
>  LSEITE=$(pdfinfo $pdf | grep Pages: | sed -e 's/Pages:[[:space:]]//g')
> echo "-l automatisch auf $LSEITE gesetzt"
> fi
> ...
> 
> In the last if-loop LSEITE will be set if LSEITE isn't set.
> This is for no parameters on command-line.
> But how I wrote: It ever works.... but now it lost the -l 104 ... the -f is 
> no 
> Problem...
> 
> My question wasn't fokused on my wrong script. I think there is something 
> wrong or limited by the System...
> Maybe you can give me a tip I should search for...
> 
> Thanks a lot
> Daniel :-)

Note that 'if [ !$LSEITE ]' becomes 'if [ ! ]' if LSEITE is not set, and
the value is true.  Maybe that's what you want, but a better way is to use
the -n or -z test operators and to *quote the variable expansion*, e.g.,

    if [ -z "$LSEITE" ]; then ...

Unquoted variables expand to nothing, and are evaluated as such.
Perhaps there are other such cases in your script?

Ken



Reply via email to