nix, shell, perl, php, mysql and mac os x tips and tricks

Thursday, April 1, 2004

Split a string into two variable in a shell script (uses a pipe as delimiter)

echo "var1|var2" | awk -F\| '{print $1, $2}'