Skip to content

Linux Shell Expansion

http://linuxgazette.net/18/bash.html

${variable%pattern}
Trim the shortest match from the end
${variable##pattern}
Trim the longest match from the beginning
${variable%%pattern}
Trim the longest match from the end
${variable#pattern}
Trim the shortest match from the beginning

Trim == REMOVE!!!

Leave a Reply