![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| deleting newline characters but not the "true" \n character | caddyjoe77 | Shell Programming and Scripting | 1 | 08-15-2007 07:21 PM |
| remove trailing newline characters | shweta_d | Shell Programming and Scripting | 7 | 06-05-2007 06:29 AM |
| Formatting a text file based on newline and delimiter characters | ntekupal | Shell Programming and Scripting | 5 | 05-11-2007 12:33 PM |
| echo command result | umen | UNIX for Dummies Questions & Answers | 2 | 11-10-2005 04:39 AM |
| FTP command result | nymus7 | IP Networking | 1 | 08-08-2005 02:01 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
how to keep newline characters in command execution result?
I found that when I used a variable to receive the result from a command execution, the newline characters were removed from the variable.
For example, I ran $ ret=`ls -l` $ echo $ret Then, I saw: total 40 -rw-r--r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk -rw-rw-r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk1 But the output I expected is: total 40 -rw-r--r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk -rw-rw-r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk1 So, the question is, how to keep the newline characters in the variable that receives the command result? Thanks. |
| Forum Sponsor | ||
|
|