User Tools

Site Tools


linux:bash_check_if_right_directory
#!/bin/bash
 
scriptdir="some-directory" && whereami=$(pwd |awk -F'/' '{print $NF}')
if [ $whereami != $scriptdir ]; then printf "\nYou are in the wrong directory! you should be here $scriptdir\n\n"; exit; fi
linux/bash_check_if_right_directory.txt · Last modified: 12/01/2024 15:00 by Allan