ksh/ifs-crash.sh
2012-02-17 13:25:26 +00:00

55 lines
529 B
Bash

#!/bin/ksh
function g
{
IFS=
}
function f
{
typeset IFS
(g)
: $V
}
f
f
trap 'echo "[${0##*/}: crash]"' SIGSEGV SIGABRT SIGBUS SIGFPE
function crash
{
typeset L_FILE
typeset L_VALIDATION
typeset L_VARIABLE
typeset L_MOD IFS
OS=$(uname)
}
crash
function crash2
{
typeset IFS
IFS='\t'
true
unset IFS
echo a b c | while read x y z; do
echo $x
echo $y
echo $z
done
}
crash2
echo a b c | while read x y z; do
echo $x
echo $y
echo $z
done
echo "[${0##*/}: success]"
# end here