I tried surrounding it with set +v and set -v but that did not do what I want. It always echo's test to stdout along with the file. It's line 15 below:
Code:
#!/bin/bash
echo "Testing Floppy..."
mkdir test
if [ ! -d test ]
then
echo "Problem creating directory."
exit 1
fi
touch test/test.txt
if [ ! -f test/test.txt ]
then
echo "Problem creating file."
exit 1
fi
echo test > test/test.txt
if ! cat test/test.txt | grep -e test
then
echo "Problem writing to file."
exit 1
fi
rm test/test.txt
if [ -f test/test.txt ]
then
echo "Problem deleting file."
exit 1
fi
rm -r test
if [ -d test ]
then
echo "Problem deleting directory."
exit 1
fi
if [ -a test/test.txt -o -a test ]
then
echo "Curiouser and curiouser. Things are FUBAR."
exit 1
fi
echo "No problems, floppy drive is good!"
Heh yes, floppies.