![]() |
|
|
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 |
| deleting newline characters but not the "true" \n character | caddyjoe77 | Shell Programming and Scripting | 1 | 08-15-2007 11:21 PM |
| remove trailing newline characters | shweta_d | Shell Programming and Scripting | 7 | 06-05-2007 10:29 AM |
| Formatting a text file based on newline and delimiter characters | ntekupal | Shell Programming and Scripting | 5 | 05-11-2007 04:33 PM |
| echo command result | umen | UNIX for Dummies Questions & Answers | 2 | 11-10-2005 08:39 AM |
| FTP command result | nymus7 | IP Networking | 1 | 08-08-2005 06:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|