Quote:
Originally Posted by
mkathi
Yes thank-you, you are right I should be more careful with the cases
Yes.
Quote:
Also can the last line MCOL="ID,NAME" be parameterized example . . . and call the script like sh myscript.sh "ID,NAME"(I think it is a silly question but never the less I am asking)
How about just trying and using
MCOL="$1"? The syntax you used is called "command substitution".
Quote:
Also I am trying to understand your code line by line could you point me how debug this code I am not asking you to explain line by line but can you pls point me towards the direction for me to better understand the code.
Thanks.
When operating on the first data line, I collect the target column numbers as indices into an array. For all remaining lines, I assemble these column values separated by commas into a TMP variable, execute
echo ... | md5sum on it,
getline the result into a variable, and, after some massaging, print the desired outout line.
Aside, if your file has more lines than
awk allows for open files, you'd need to close the system calls after each use...