Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash read file and output

#!/bin/bash
value=$(pwd)
regex='.*/([a-zA-Z0-9._]*)/([a-zA-Z0-9._]*)$'
echo You are here: $value
echo The folder is: ${value##*/}
[[ $value =~ $regex ]]
echo Parent folder: ${BASH_REMATCH[1]}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #read #file #output
ADD COMMENT
Topic
Name
5+6 =