Saturday, March 26, 2016

Awk / Read to set multiple variables in shell

eval $(awk 'BEGIN{print "var=17"; print "var2=18"}')

eval $(echo "ola mundo cruel" | awk '{ print "var="$1; print "var2="$2; print "var3="$3 }')


read a b c <<< "ola mundo cruel"

No comments:

Blog Archive