From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 21 Mar 2012 14:20:17 +0100 Message-ID: From: yy To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] removing spaces from filenames Topicbox-Message-UUID: 6cbbbf42-ead7-11e9-9d60-3106f5b1d025 2012/3/21 Peter A. Cejchan : > for (old in `{9 ls *.$EXT}) { Here you are iterating over the elements of `{9 ls *.$EXT}, sepparated by $ifs. Therefore, spaces are breaking your lines into word fields. This is not what you want. Your second example directly process whole lines (uses sed), so it works. I think you will get what you want if you replace this line with: ifs=' ' for (old in `{9 ls *.$EXT}) { -- - yiyus || JGL .