![]() |
|
|
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 |
| Problem in read() from a pipe | JDS | High Level Programming | 2 | 10-13-2006 11:19 AM |
| Problem with read & write | EltonSky | High Level Programming | 11 | 08-31-2006 03:35 PM |
| File read & execute problem | tipsy | Shell Programming and Scripting | 5 | 08-14-2006 06:01 PM |
| SH script problem with read | pmpx | Shell Programming and Scripting | 2 | 10-05-2005 02:40 PM |
| read after pipe problem OSX10.4 | relyveld | Shell Programming and Scripting | 5 | 07-07-2005 09:56 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Problem with read in sh
I've discovered a very annoying problem in sh: Code:
echo -en "one\ntwo\nthree" | while read VALUE
do
echo "${VALUE}"
done
This will print one and two, but not three. The last line is IGNORED because it lacks a newline. This makes it hard to use sh for things like CGI scripting; you have to add a newline with sed or something. How can I coerce read into reading the last line? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|