Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Creating test files"
  3. if touch file1.txt && touch file1.txt.bak.tar.gz && touch file1.doc.bak && touch file1noextension
  4. then
  5. echo "Created test files!"
  6. else
  7. echo "Could not create test files! Exiting now!"
  8. exit 1
  9. fi
  10. echo "Calling q3.sh to modify files to have the FOO extension"
  11. ./q3.sh FOO
  12. 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 ]
  13. then
  14. echo "All tested files now have the FOO extension"
  15. echo "Removing created files and renaming scripts to *.sh"
  16. rm file1*
  17. mv test1.FOO test1.sh
  18. mv test2.FOO test2.sh
  19. mv test3.FOO test3.sh
  20. mv q1.FOO q1.sh
  21. mv q2.FOO q2.sh
  22. mv q3.FOO q3.sh
  23. exit 0
  24. else
  25. echo "Something went wrong! Exiting now!"
  26. exit 1
  27. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement