![]() |
|
|
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 |
| HOWTO Append String to End of Line | bggibson | UNIX for Dummies Questions & Answers | 3 | 08-15-2008 05:04 PM |
| Line Count and Append it to the end of the file. | smc3 | Shell Programming and Scripting | 7 | 06-28-2008 11:39 AM |
| append a character at end of each line of a file | muaz | Shell Programming and Scripting | 4 | 06-25-2008 08:48 AM |
| Append text at end of the first line in a file | catgovind | Shell Programming and Scripting | 7 | 05-01-2008 08:33 AM |
| How to Append a Value to each line of the file | dsshishya | UNIX for Dummies Questions & Answers | 11 | 03-21-2008 02:48 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
hi
i have the following function, reading file line by line, if line contains "Change state" i need to cut some fields otherwise i need to append the total line to the new file function parse() { while read LINE do echo $LINE |grep -q "Change state" if [ "$?" -eq 0 ] then echo $LINE |grep -q "Change state" | cut -d ' ' -f 7-7 >>change.txt else $LINE >> change.txt fi done < $file } parse |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|