I am currently saving string outputs from expressions like so
SOME_PATH="/some/path/file"
FILE_NAME=`echo "$SOME_PATH" | rev | cut -f 1 -d "/" | rev )`
FILE_FOLDER=`echo "$SOME_PATH" | sed s/$FILE_NAME//`
echo ${SOME_PATH}
echo ${FILE_NAME}
echo ${FILE_FOLDER}
which seems like the echo is superfluous, but I couldn't get it to work without it. What is the preferred way?