![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 6 | 10-25-2008 01:37 PM |
| How to find the free space & usage of the particular directory in Hp-Unix? | bobprabhu | UNIX for Dummies Questions & Answers | 2 | 06-27-2008 02:05 PM |
| aix memory breakdown | shahidsa | AIX | 1 | 01-04-2008 12:38 PM |
| sed command breakdown | hcclnoodles | Shell Programming and Scripting | 1 | 09-09-2002 10:35 AM |
| Space in the directory name | nitin | UNIX for Advanced & Expert Users | 5 | 10-06-2001 05:32 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
for i in `find *` breakdown since the directory name has space
hey, somebody can help me on this broken script?
for i in `find . -name index.html`;do echo "$i" awk '{print $0}' $i done the path to index.html has space in it. For example, ./10 October/index.html then echo "$i" will gives two lines instead of one: ./10 October/index.html how do I quota the `find ` properly? thanks! |
|
||||
|
thanks! works like a charm. for i in 'find ...' is so commonly seen as an example, it seems I should always use the while statement in future.
by the way, "man read", "man while" didn't give me manual of "read", though intuitively it is quite understandable, I would like to see the manual for learning. please give me a reference. thanks. |
|
||||
|
man ksh
See: while list do list done In this case the input list is coming from a shell read of the pipe (i.e. the output from find). Shell read is also described in "man ksh". Expanding a long list of files in a "for" command can produce a syntax error because the command line gets too long. My example works with any number of files. |
![]() |
| Bookmarks |
| Tags |
| find space, shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|