![]() |
|
|
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 |
| add carriage return at end of file | HAA | Shell Programming and Scripting | 2 | 11-20-2007 11:58 AM |
| Carriage Return at end of file | bd_joy | Shell Programming and Scripting | 14 | 10-20-2006 02:20 PM |
| How to delete carriage return in SED | stevefox | Shell Programming and Scripting | 3 | 12-23-2005 06:03 AM |
| Dont want carriage return | videsh77 | Shell Programming and Scripting | 3 | 12-16-2004 09:26 PM |
| Capture carriage return. | gio123bg | Shell Programming and Scripting | 4 | 12-15-2003 10:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi everybody!
I'm working in one script with sed, I have file with the next content: <voms.db.type value="changeme"/> <voms.db.host value="changeme"/> <voms.admin.smtp.host value="changeme"/> <voms.mysql.admin.password value="changeme"/> <glite.installer.verbose value="true"/> I want the output file is as follows <voms.db.type value="changeme"/> <voms.db.host value="changeme"/> <voms.admin.smtp.host value="changeme"/> <voms.mysql.admin.password value="changeme"/> <glite.installer.verbose value="true"/> Thanks for your help |
|
||||
|
Another one, if the last character of the line isn't a ">", add the next line into the contents of the pattern space and delete the newline character: Code:
sed -n '/[^>]/$/N;s/\n//p' file With awk, if the last character of the line isn't a ">" print the line without a newline: Code:
awk '!/>$/{printf("%s",$0);next}1' file
Regards Last edited by Franklin52; 10-09-2008 at 02:24 PM.. Reason: adding comments |
|
||||
|
Quote:
joeygthe spaces are necesary, because after, I need capturing lines for show with Dialog, and the delimiter is value="changeme"... I change should be replaced by the user... <voms.db.type value="changeme"/> <voms.db.host value="changeme"/> Thank You for your help |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|