#!/usr/bin/env bash path="src/main/app.sh" # # removes the shortest leading match, ## the longest echo "${path#*/}" echo "${path##*/}"
${s#pattern} removes a leading match