Daily Archives: July 23, 2011

Escape asterisk * in file when cat -ing it in ksh

If you were to want to read the contents of a file in ksh, and the file just so happens to contain problematic characters like *, do this in your script: set -f prior to doing: sql=`cat $sql_file`;   More info (from http://www.computing.net/answers/unix/escaping-in-korn-shell/7016.html): echo $- ism set -f echo $- isfm echo $sample test* set +f […]