### delete shortest match at "^":
### ../hmm -> ./hmm
echo ${path#.}
### delete longest match at "^":
### ../hmm -> /hmm
echo ${path##.}
### delete shortest match at "$":
### /hmm// -> ./hmm/
echo ${path%/}
### delete longest match at "$":
### /hmm// -> /hmm
echo ${path%%/}
### replace once:
### dir/subdir/file -> dir\/subdir/file
echo ${path/\//\\/}
# ### replace globally:
# ### dir/subdir/file -> dir\/subdir\/file
#echo ${path//\//\\/}
# ### replace slash at "^":
# ### /absolute/path -> relative/path
#echo ${path/#\///}
# ### replace slash at "$":
# ### /path/to/ -> /path/to
#echo ${path/%\///}
# ### split string at first "/":
# ### /path/to/ -> path/to/
echo ${path#*/}