Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created October 25, 2008 07:39
Show Gist options
  • Select an option

  • Save wfarr/19717 to your computer and use it in GitHub Desktop.

Select an option

Save wfarr/19717 to your computer and use it in GitHub Desktop.
#!/bin/sh
mkdir ln_test && cd ln_test/
echo "Some test" > test_file
echo "Make sure test_file exists"
echo ""
exist=`ls -ali | grep test_file`
if [ "$exist" != "" ]; then
echo "test_file exists"
else
echo "test_file does not exist"
exit
fi
echo ""
echo "Symlinking test_file to dummy"
echo ""
ln -s test_file dummy
exist=`ls -ali | grep "dummy -> test_file"`
if [ "$exist" != "" ]; then
echo "dummy -> test_file"
echo "wfarr rocks"
else
echo "the symlink didn't work, wfarr is a doodyhead"
fi
echo ""
echo "Want to go ahead and delete the stuff this test made? [Y/n]"
echo ""
read KILL
if [ "$KILL" = "n" ]; then
exit
elif [ "$KILL" = "N" ]; then
exit
else
cd ../ && rm -rf ln_test/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment