From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29976 invoked from network); 29 Jan 2004 22:52:10 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 29 Jan 2004 22:52:10 -0000 Received: (qmail 25128 invoked by alias); 29 Jan 2004 22:51:50 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7029 Received: (qmail 25117 invoked from network); 29 Jan 2004 22:51:50 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 29 Jan 2004 22:51:50 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [213.97.199.90] by sunsite.dk (MessageWall 1.0.8) with SMTP; 29 Jan 2004 22:51:38 -0000 Received: (qmail 9112 invoked by uid 500); 29 Jan 2004 22:50:17 -0000 Date: Thu, 29 Jan 2004 23:50:17 +0100 From: David =?iso-8859-15?Q?G=F3mez?= To: Zsh-users Subject: Positional parameters with more than one space Message-ID: <20040129225017.GA9097@fargo> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.1i 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