Advertisement
achshar

Untitled

Jan 28th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. menu() {
  2. clear
  3. printf "Here are the operations you can do on your file\n\n\t1. Word Count of a file\n\t2. First 10 lines of a file\n\t3. Last 10 lines of a file\n\t4. Content of file before and after sorting\n"
  4. read option
  5. printf "\nEnter the path to the file:\n"
  6. read path
  7. case $option in
  8. 1 ) wc $path ;;
  9. 2 ) head $path ;;
  10. 3 ) tail $path ;;
  11. 4 )
  12. printf "\nBefore sorting...\n"
  13. cat $path
  14. sort -k1 $path
  15. printf "\nAfter sorting...\n"
  16. cat $path
  17. ;;
  18. esac
  19. read
  20. menu
  21. }
  22. menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement