Re:Four features that justify a new Unix shell
by zimpenfish on Friday October 23, 2020 @10:38PM
(#24876493)
If you have that in a variable, which you presumably would if you're reading them one at a time, you can use "remove longest matching prefix" substitution.
[Edit: 'thezilch beat me too it by a couple of minutes]
[ Parent
| on HN ]
Re:Four features that justify a new Unix shell
by sergeykish on Saturday October 24, 2020 @08:22AM
(#24878727)
This part is really cryptic, I would prefer
$ function remove_longest_matching_prefix () { echo "${1##$2}"; }
$ remove_longest_matching_prefix "$i" '*/'
track1.mp3
awk -F/ accepts stream as in perl example