Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- read -r a
- cd Documents
- if find . -maxdepth 1 -name "$a" -print -quit | grep -q .
- then
- echo "The file has been found"
- echo "Here are some details of the file for you:"
- ls -l "$a"
- echo "The path of this file:"
- readlink -f "$a"
- echo "The file type:"
- file "$a"
- else
- echo "I have not found the requested file in the Documents directory."
- cd
- if find . -maxdepth 1 -name "$a" -print -quit | grep -q .
- then
- echo "The file has been found at:"
- readlink -f "$a"
- echo "Here are some details of the file for you:"
- ls -l "$a"
- echo "The file type:"
- file "$a"
- else
- echo "The file does not exist, or you typed it absolutely wrong."
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment