Skip to content

Instantly share code, notes, and snippets.

@a2gs
Created March 12, 2019 20:03
Show Gist options
  • Save a2gs/5dc5f16403d36902c6f22ef71848ebc4 to your computer and use it in GitHub Desktop.
Save a2gs/5dc5f16403d36902c6f22ef71848ebc4 to your computer and use it in GitHub Desktop.
Shell script calling a (inside) AWK script
#!/usr/bin/sh
func(){
awk -v VAR1=$3 -v VAR2=$4 '
BEGIN{
}
{
print VAR1 VAR2
print
}
END{
}' $1 > $2
}
OUT="$1"_out
func $1 $OUT "asd" "qwe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment