• Source
    1. #
    2. #Write a script to find the global complete path for any file.
    3. #
    4. echo -n "Enter the filename to search in current directory: \c"
    5. read filename
    6. current=$(pwd)
    7. files=`find $current -name $filename`
    8. count=0
    9. for i in $files
    10. do
    11. if [ -f "$i" ]
    12. then
    13. echo $i
    14. count=$(echo $count + 1 | bc -l)
    15. fi
    16. done
    17. if [ $count -eq 0 ]
    18. then
    19. echo "File does not exist"
    20. fi