Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- goto(){
- if [ -z "$1" ]; then
- printf "No argument supplied \nUsage: goto [FOLDER_NAME]\n"
- else
- find . -maxdepth 4 -type d > temporarybashoutputfile 2> >(grep -v 'Permission denied' >&2)
- VAR=$(cat temporarybashoutputfile)
- rm temporarybashoutputfile
- DIR=$(echo "${VAR}" | grep ".*/$1$")
- if [ -z ${DIR} ]; then
- echo "Directory not found"
- else
- cd ${DIR}
- fi
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement