AWK Beginner needs help in script
AWK Beginner needs help in script
(OP)
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
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
RE: AWK Beginner needs help in script
Your requirements are clear as mud.
Do you mean the times and/or lines where a certain string appears in a file?
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb