Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Creating test files"
- if touch file1.txt && touch file1.txt.bak.tar.gz && touch file1.doc.bak && touch file1noextension
- then
- echo "Created test files!"
- else
- echo "Could not create test files! Exiting now!"
- exit 1
- fi
- echo "Calling q3.sh to modify files to have the FOO extension"
- ./q3.sh FOO
- if [ -e file1.FOO ] && [ -e file1.txt.bak.tar.FOO ] && [ -e file1noextension.FOO ] && [ -e file1.doc.FOO ] && [ ! -e file1.txt ] && [ ! -e file1.txt.bak.tar.gz ] && [ ! -e file1noextension ] && [ ! -e file1.doc.bak ]
- then
- echo "All tested files now have the FOO extension"
- echo "Removing created files and renaming scripts to *.sh"
- rm file1*
- mv test1.FOO test1.sh
- mv test2.FOO test2.sh
- mv test3.FOO test3.sh
- mv q1.FOO q1.sh
- mv q2.FOO q2.sh
- mv q3.FOO q3.sh
- exit 0
- else
- echo "Something went wrong! Exiting now!"
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement