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

Re: Conditional Bug?

Peter Stephenson <pws@xxxxxxx> writes:

> Joel J. Adamson wrote:
>> I'm using I have the following script to backup my important files, and I've
>> been running it from cron and getting errors from the tar command.
>> I'm concerned about the conditional at line 22: is my usage wrong or
>> is this a bug?  The conditional says that the file exists (when it
>> does not) and therefore runs the "--update" version of tar.
>> +backup:7> [[ -e /mnt/backup/backup.tar.bz2 ]]
> Yes, that tests whether the file exists and returns true if it does.

Okay, I've done some more testing and found that the problem is with
my parameter assignment.  In the tar invocation, I need all the
filenames submitted in the command, and various combinations of $* and
$@ with and without quotes don't seem to work: they either use the
whole list as a single argument, which brought up the error I
originally posted, or only use the first directory (~/ado in my

What is the proper way to refer to all command line arguments?


Joel J. Adamson
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.

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