in red-hat i can use the ‘i’ flag, /regex/i
in solaris it doesnt work and I’m looking for a way to do it also.
my script is:
ls -1 /webapp/dir/bin | awk '/AR[0-9]+/ && /SMF_LOG/ {dp_pkg=substr($NF,index($NF,"AR")+2); print $NF"@"dp_pkg}' | sort -k2 -t '@' -nr | head -n1 | cut -d'@' -f1
Use
and a similar pattern match instead of
indexin the rule. Or, if this is an option, translate all chars to upper (or lower) case before you process them, e.g. withtr "[A-Z]" "[a-z]".