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

Re: Conditional Bug?



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

> On Oct 29,  4:37pm, Joel J. Adamson wrote:
> }
> } Okay, I've done some more experimenting (including setting the
> } variables to arrays and other things) and discovered that a big
> } problem is that when the filenames get through to the tar command,
> } they are quoted, and thus the tilde does not expand.
>
> You're being misled.  The trace will show them quoted so that cut-and-
> paste will work, even if they weren't quoted originally.

I see...

>
> What you need is not to remove quoting, but to enable file
>expansion:
>
>     ${~arrayname}
>

The problem was that I was treating the filenames the same in the
initial assignment (from the command line) and in the function's
internal assignment.  What I needed to do was realize that the first
time it's an array, and the second time it's an expansion of an array:

within the function:
    TOBACKUP=($@)

Before invoking the function:    
    TOBACKUP=("$@")    

Thanks for all your help!    
Joel

-- 
Joel J. Adamson
Biostatistician
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