Bash

Expression

#!/bin/sh
#
 
expression() {
file="/home/starlits/html/long.file.name"
 
echo "
${file##/*/}    #                     long.file.name
${file#/*/}     #       starlits/html/long.file.name
$file           # /home/starlits/html/long.file.name
${file%.*}      # /home/starlits/html/long.file
${file%%.*}     # /home/starlits/html/long
"
}
expression