I have a script which is used by awk, helped in creation by people from here.
I understand this:
says if the input line ($0) contains (~) "lk" followed by the variable olddb's value at the end ($) OR the input string contains the variable olddb's value followed by ".ora", at the end ($) then set proceed to "#"
How can I use an extended line or series of lines on a similar test:
to say if the input line ends in ".ctl" then print three lines.
However, [] do not seem to work and even trying three lines of IF... with () and printf... fails.
Please assist!
Thanks
Applications Support
UK
I understand this:
Code:
preceed="";if($0~"lk"olddb"$" || $0~olddb".ora$")preceed="#"
says if the input line ($0) contains (~) "lk" followed by the variable olddb's value at the end ($) OR the input string contains the variable olddb's value followed by ".ora", at the end ($) then set proceed to "#"
How can I use an extended line or series of lines on a similar test:
Code:
if [ $0~".ctl$" ]
then
printf "%s -p %s %s\n", "echo rm", $0 >>rscript
printf "%s -p %s %s\n", "echo rm", $0 " >> "restlogfile >>rscript
printf "%s -p %s %s\n", "rm", $0 " >> "restlogfile " 2>> "restlogfile >>rscript
endif
to say if the input line ends in ".ctl" then print three lines.
However, [] do not seem to work and even trying three lines of IF... with () and printf... fails.
Please assist!
Thanks
Applications Support
UK