@apmcd47, my AIX doesn't have the flags you suggested, but thanks anyway
hi, couple of questions
/^.*=|
what does this mean in the regex part of gsub?
^.*=|\)/, ""
in the gsub() function are you saying -> replace the occurrence of this regex with nothing or no space. I think you have replaced the occurrence of the regex with a space
" "
in the sub() function
You have used a semicolon to separate gsub() and sub(). Do semi colons work as the same way a pipe (|) does? I ran the gsub and sub separately and from what I could figure out, you are working on the output of gsub in sub().
/.../ is a regular expression; c.f. man awk : "Regular expressions are enclosed in slashes". A single / is pointless. ^ anchors the regex at begin-of-line (or string). .* represents "any char, zero or more times". = terminates this special regex. As we are sure there's only ONE = in $1 , no additional measures need to be taken. | is the alternation operator ("or"), so multiple regexes can be matched
Yes, that's why I used two function calls: for different results. If you accept leading and trailing spaces, try gsub (/^.*=|\)|\(/, " ", $1) and drop the sub .
Semicolons separate commands in awk , as do line feeds. gsub modifies $1 , then sub works on that mod'd $1