Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Strange behaviour in zsh-2.5.03



Sverre Slotte <sverre@xxxxxxxxxxxxxxxxxx> writes:

>                     passthru="$passthru $1"
                                         ^
It's this space that gets in the way.  The passthru variable will
consist of the filename with a space added to the end, which makes a
new filename that does not exist.  Similarly, if you have more files,
they will all become a single argument in the following command, being
interpreted as a single file name.

>         command lpr -P${printer} ${passthru}    # this doesn't work!

As long as you don't have filenames which themselves contain
whitespace, replacing ${passthru} with ${=passthru} should do the job,
as this will split the variable into different words.

Hope this helps.

Bas.



Messages sorted by: Reverse Date, Date, Thread, Author