![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| How to rewrite a line in a file | c0384 | Shell Programming and Scripting | 21 | 05-21-2007 11:06 PM |
| How do I rewrite to use a while instead of find? | goodmis | Shell Programming and Scripting | 4 | 02-06-2007 10:20 AM |
| Make grep -c display like grep -n? | Jerrad | Shell Programming and Scripting | 2 | 08-24-2006 09:20 PM |
| rewrite the same info in 3 different files | strok | Shell Programming and Scripting | 6 | 03-29-2003 09:50 AM |
| Apache Rewrite help! | hassan2 | UNIX for Advanced & Expert Users | 1 | 11-11-2002 09:35 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Delete
Thanks , franklin you method worked, i knew i had to use a while loop and getline in there just didnt know the proper order
Hi everyone, im trying to make the following command line shorter by introducing a script that join up all the grep commands ./new1a < numbers.txt | grep -i -v '^a ' | grep -i -v '^the ' | grep -i -v '^or ' | sort -f How would I go about merging all the greps into a scripe and putting all the words that should be excluded into a data file Last edited by weezybaby; 01-31-2008 at 02:44 PM. |
| Forum Sponsor | ||
|
|
|
|||
|
The OP deleted his question, for clarity, this was the request:
Quote:
Try this: Code:
./new < numbers.txt | awk '
BEGIN{while(getline < "datafile.txt" > 0 ) {
arr[$1]=$1
}
close("datafile.txt")
}
!arr[$1]{print}
'
Last edited by Franklin52; 01-31-2008 at 11:46 PM. |