madmurdock
MIS
- Jan 13, 2003
- 105
Hi out there,
trying to get one certain string out of a textfile and want to look if that string has another appearance in the same file and print it out. What I have so far is:
From this finding ( especially $2 ) I want to find out another appearance. Do not know how to code that.
And yes, you assumed right, input file is /etc/sudoers ..
Thx for your help
mad
Advanced Interactive eXecutable
trying to get one certain string out of a textfile and want to look if that string has another appearance in the same file and print it out. What I have so far is:
Code:
grep -v ^# textfile | awk 'BEGIN {RS=""} /\/usr\/bin\/vi|more|less|find|awk|man/ { if ( $0 !~ /[nN][oO][eE][xX][eE][cC]/ || $0 ~ /![ \t]*[nN][oO][eE][xX][eE][cC]/) { printf("%s:%s : noexec does not exist \n",$1,$2) ; }}'
From this finding ( especially $2 ) I want to find out another appearance. Do not know how to code that.
And yes, you assumed right, input file is /etc/sudoers ..
Thx for your help
mad
Advanced Interactive eXecutable