32 |
status=1 |
status=1 |
33 |
fi |
fi |
34 |
|
|
35 |
|
if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?"?[.,_x]' $scripts; then |
36 |
|
echo "use \`test \"X...\"' instead of \`test \"x...\"'" |
37 |
|
status=1 |
38 |
|
fi |
39 |
|
|
40 |
# Check for using test X... instead of test "X... |
# Check for using test X... instead of test "X... |
41 |
if egrep -n -e 'test[ ]+X' $scripts; then |
if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X' $scripts; then |
42 |
echo "use \`test \"X...\"' instead of \`test X'" |
echo "use \`test \"X...\"' instead of \`test X'" |
43 |
status=1 |
status=1 |
44 |
fi |
fi |
45 |
|
|
46 |
# Check for using test $... instead of test "$... |
# Check for using test $... instead of test "$... |
47 |
if egrep -n -e 'test[ ]+(-.[ ]+)?X?\$' $scripts; then |
if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X?\$' $scripts; then |
48 |
echo "use \`test \"\$...\"' instead of \`test \$'" |
echo "use \`test \"\$...\"' instead of \`test \$'" |
49 |
status=1 |
status=1 |
50 |
fi |
fi |
51 |
|
|
52 |
# Never use test -e. |
# Never use test -e. |
53 |
if egrep -n -e 'test[ ]+-e' $scripts; then |
if egrep -n -e 'test[ ]+(![ ])?-e' $scripts; then |
54 |
echo "use \`test -f' instead of \`test -e'" |
echo "use \`test -f' instead of \`test -e'" |
55 |
status=1 |
status=1 |
56 |
fi |
fi |