[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Spaces in File name Handling
From: |
Paul Jarc |
Subject: |
Re: Spaces in File name Handling |
Date: |
Thu, 11 Mar 2004 10:43:01 -0500 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
alupu@att.net wrote:
> #3. However, the "real" case, doesn't work ...
> TMP=`ls -AQ`
> for i in "$TMP" ; do ls -ld "$i" ; done
Since "$TMP" is quoted, it won't be split, and the loop will run only
once, with i set to the full value of $TMP. Don't quote $TMP, and
make sure it gets split only at newlines, not other whitespace:
TMP=`ls -A`
IFS=$'\n'
for i in $TMP ; do ls -ld "$i" ; done
Alternatively:
for i in .[!.] .??* *; do ls -ld "$i"; done
paul