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

Re: globbing with interposition



    Hi Eric :)

 * Eric Smith <es@xxxxxxxxxxxx> dixit:
> So, I would like to do something like this (which obviously
> dont work) in order to achieve the above.
> 
> mutt eric -a fotos* -s "all images attached" </dev/null

    Quick'n'dirty hack (obviously must exist a better solution):

    mutt eric `for file in * ; print -- -a $file' -s ...

    The main problem is that this doesn't work with files that has
spaces in the name. If mutt doesn't need a space between '-a' and the
file name for the attach, you can do this:

    mutt eric "`for file in * ; print -- -a $file'" -s ...

    This quotes the space between the '-a' and the filename. I don't
know of any other solution that you can use in the command line. If
you need selective quoting you can 'build' the command line:

    commandline=(mutt eric)
    for file in *
    do
        commandline+=(-a "$file")
    done
    commandline+=(-s "all...")
    
    After that, you run this:
    $ $commandline </dev/null

    Hope that helps :)

    Raúl Núñez de Arenas Coronado

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



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