This is how we use a command line / bash variable (named num) in a awk command. We define an awk variable 'var' with -v option. This also shows use of BEGIN block.
awk -F, -v var=$num 'BEGIN{srand(var)} {print $1","$2","rand()}' file_name
A few Day-to-Day life tricks of Linux.
No comments:
Post a Comment