This a question of an exercise:
What is the difference between the two "if" instructions?
echo -n > tmp
for f in $*
if test ! -f $f
echo $f does not exist as a file
if [ ! -f $f ]
echo $f has been deleted successfully
ls $f >> tmp
x='cat tmp | grep -c ^.*$'
echo result: $x
The square brackets are a synonym for the test command, instead of
if test ! -f $f we can use
if [ ! -f $f ].
test is a command which takes expression and test or evaluates.