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

Positional parameters with more than one space



Hi all ;),

I'm coding a shell function that receives several files as parameters. These
files usually will have spaces in its names, so i want this function to
work correctly with spaces. 

I'm using the $@ array to iterate thru all parameters, with a for loop:

for i in "$@"; do
 something
done

And it works fine, except when a file has more that one space in its name.
I mean, if one of the files is "more than  one space", after the $@
expansion it transforms to "more that one space" which obviously doesn't
exists. How can i avoid this?

Thanks a lot,

-- 
David Gómez

"The question of whether computers can think is just like the question of
 whether submarines can swim." -- Edsger W. Dijkstra



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