command line - bash - echo negation - Ask Ubuntu


echo ${string##*.}   # show after last "." 

how can revert (negate) - show before last "."

${string%.*} remove shortest trailing portion matching .*

see example parameter expansion in excellent bashguide


Comments

Popular posts from this blog

crash - Windows Rundll32 (child process of DllHost) is crashing. How can I even identify it? - Super User

debian - Kali Linux - Debootstrap error Failed to determine codename for the release - Super User

networking - Slave steals IP meant for bonded interface - Ask Ubuntu