Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu() {
- clear
- 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"
- read option
- printf "\nEnter the path to the file:\n"
- read path
- case $option in
- 1 ) wc $path ;;
- 2 ) head $path ;;
- 3 ) tail $path ;;
- 4 )
- printf "\nBefore sorting...\n"
- cat $path
- sort -k1 $path
- printf "\nAfter sorting...\n"
- cat $path
- ;;
- esac
- read
- menu
- }
- menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement