Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Positional parameters with more than one space
- X-seq: zsh-users 7029
- From: David Gómez <david@xxxxxxxxxxxx>
- To: Zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Positional parameters with more than one space
- Date: Thu, 29 Jan 2004 23:50:17 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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