1*9a7741deSElliott Hughesecho T.flags: test some commandline flags 2*9a7741deSElliott Hughes 3*9a7741deSElliott Hughesawk=${awk-../a.out} 4*9a7741deSElliott Hughes 5*9a7741deSElliott Hughes$awk >foo 2>&1 6*9a7741deSElliott Hughesgrep '[Uu]sage' foo >/dev/null || echo 'T.flags: bad usage' 7*9a7741deSElliott Hughes 8*9a7741deSElliott Hughes$awk -f >foo 2>&1 9*9a7741deSElliott Hughesgrep 'no program' foo >/dev/null || echo 'T.flags: bad no program' 10*9a7741deSElliott Hughes 11*9a7741deSElliott Hughes$awk -f glop/glop >foo 2>&1 12*9a7741deSElliott Hughesgrep 'can.t open' foo >/dev/null || echo 'T.flags: bad can.t open program' 13*9a7741deSElliott Hughes 14*9a7741deSElliott Hughes$awk -fglop/glop >foo 2>&1 15*9a7741deSElliott Hughesgrep 'can.t open' foo >/dev/null || echo 'T.flags: bad can.t open program 2' 16*9a7741deSElliott Hughes 17*9a7741deSElliott Hughes$awk -zz 'BEGIN{}' >foo 2>&1 18*9a7741deSElliott Hughesgrep 'unknown option' foo >/dev/null || echo 'T.flags: bad unknown option' 19*9a7741deSElliott Hughes 20*9a7741deSElliott Hughes$awk -F >foo 2>&1 21*9a7741deSElliott Hughesgrep 'no field separator' foo >/dev/null || echo 'T.flags: bad missing field separator' 22*9a7741deSElliott Hughes 23*9a7741deSElliott Hughes### Awk is now like gawk and splits into separate characters if FS = "" 24*9a7741deSElliott Hughes# $awk -F '' >foo 2>&1 25*9a7741deSElliott Hughes# grep 'field separator FS is empty' foo >/dev/null || echo 'T.flags: bad empty field separator' 26