xref: /freebsd/contrib/one-true-awk/testdir/T.main (revision 23f24377b1a9ab6677f00f2302484d6658d94cab)
1echo T.main: misc tests of arguments in main
2
3awk=${awk-../a.out}
4
5rm -f core
6
7# test -d option
8
9
10
11echo hello | $awk -d '{print}' >foo1
12if test -r core; then echo 1>&2 "BAD: T.main awk -d dropped core"; fi
13
14echo 'a::b::c' >foo
15$awk -F:: '{print NF}' foo >foo1
16echo '3' >foo2
17diff foo1 foo2 || echo 'bad: awk -F::'
18
19echo 'a::b::c' >foo
20$awk -F :: '{print NF}' foo >foo1
21echo '3' >foo2
22diff foo1 foo2 || echo 'bad: awk -F ::'
23
24echo 'a	b	c' >foo
25$awk -F t '{print NF}' foo >foo1
26echo '3' >foo2
27diff foo1 foo2 || echo 'bad: awk -F (tab)'
28
29echo 'atabbtabc' >foo
30$awk -F tab '{print NF}' foo >foo1
31echo '3' >foo2
32diff foo1 foo2 || echo 'bad: awk -F tab'
33