space in file name Error
Can someone please suggest how to print out the names of files having space in between them.
I am running the following for loop , but the thing is it is treating space delimiter between file names as new file ......please help ************************************************* >>>>>>>>>ls -lrt total 0 -rw-r--r--. 1 root root 0 Oct 31 11:31 file 3 -rw-r--r--. 1 root root 0 Oct 31 11:31 file 2 -rw-r--r--. 1 root root 0 Oct 31 11:31 file 1 >>>>>for i in `ls`; do echo $i;echo "****"; done file **** 1 **** file **** 2 **** file **** 3 **** |
In a previous thread it was suggested to prefer "while" over "for" loops. See if you can deal with things using:
Code:
find /path/ type f -iname file\* | while read ITEM; do * In previous threads you have also been made aware of mywiki.wooledge.org and the Advanced Bash Scripting Guide. I'm going to add a few links in the hope you read and consult them: http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://www.tldp.org/LDP/Bash-Beginne...tml/index.html http://www.gnu.org/software/bash/man...ode/index.html http://www.grymoire.com/Unix/Sh.html http://www.tldp.org/LDP/abs/html/ http://mywiki.wooledge.org/BashFAQ http://mywiki.wooledge.org/BashPitfalls |
???????????
|
Also mark your own threads you replied to today as "solved" if they are and don't post this kind of "????" nonsense.
|
Thankz for ur heartfelt comments .. I didnt understand that y written ?..
|
Quote:
Code:
find /path/ type f -iname file\* | while read ITEM; do echo "${ITEM}"; echo "****"; done |
All times are GMT -5. The time now is 11:32 PM. |