![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Of bash and whitespace... | lev_lafayette | Shell Programming and Scripting | 2 | 04-13-2008 09:44 PM |
| Bash while loop problem | Kweekwom | Shell Programming and Scripting | 5 | 07-23-2007 01:49 AM |
| error in bash script 'if' loop | DILEEP410 | Shell Programming and Scripting | 2 | 06-06-2007 09:04 AM |
| Simple bash for loop problem | kingdbag | Shell Programming and Scripting | 4 | 09-15-2006 02:00 AM |
| while read loop preserving leading whitespace | zazzybob | Shell Programming and Scripting | 3 | 06-07-2004 06:36 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Preventing whitespace to be a delimiter in a for loop (bash/sh)
Hi,
I have a for loop which iterates over a list of strings, separated by whitespace: Code:
$ list="1 2 3" $ for i in $list; do echo $i; done 1 2 3 Code:
$ for i in 1\ 2 3; do echo $i; done 1 2 3 Code:
$ list="1\ 2 3" $ for i in $list; do echo $i; done 1\ 2 3 BTW: The for loop is not written by myself, but is burried deep in a build script I do not want to change ... Thanks in advance! Kai Koehne |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|