Extract given file path into its parts Assuming, file passed as a parameter path=$1 following script will extract file path into parts