Search Results

Search: Posts Made By: doublefrangelic
31,205
Posted By zazzybob
You probably won't have nawk, but you'll have...
You probably won't have nawk, but you'll have gawk - normally "awk" is hard/soft linked to gawk anyway....

which gawk
which awk
which nawk
etc... to see what you have in your path...

Cheers...
Forum: Solaris 12-07-2006
123,633
Posted By Ygor
Try...nawk...
Try...nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=2 a=4 s="string" file1...where "b" and "a" are the number of lines to print before and after string "s".
...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 02:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy