From: "David Gómez" <david@pleyades.net>
To: Zsh-users <zsh-users@sunsite.dk>
Subject: Positional parameters with more than one space
Date: Thu, 29 Jan 2004 23:50:17 +0100 [thread overview]
Message-ID: <20040129225017.GA9097@fargo> (raw)
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
next reply other threads:[~2004-01-29 22:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-29 22:50 David Gómez [this message]
2004-01-30 0:23 ` Bob Schmertz
2004-02-02 8:52 ` David Gómez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040129225017.GA9097@fargo \
--to=david@pleyades.net \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).