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

Re: Printing arrays for use with $()



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> On Aug 11,  6:16pm, DervishD wrote:
> }     Is there any way for printing the array to stdout and being able
> } to use that output as arguments for another command?
> The short answer is, no.

    I've been trying this (without success):

    command $(printf '"%s "' $array) 

    The thing is that the 'printf' command prints the file names
exactly as I want them, within double quotes, but 'command' see those
double quotes... quoted. Any way of avoiding this? I think that it
may be a solution.

    I'm completely lost and I don't know how to make this script. The
only solution seems to be convert it to a shell function and use
'reply', but I need it to be able to be run as a command, not as a
function :(

    The worst thing is that I had the intention of using a couple
more scripts in this way, generating a list of files to work on and
dumping it to stdout :( but without being able to solve this
problem...

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



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