Created
October 25, 2008 07:39
-
-
Save wfarr/19717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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