alias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 2 days agoEven better than the originallemmy.worldimagemessage-square12fedilinkarrow-up197arrow-down13
arrow-up194arrow-down1imageEven better than the originallemmy.worldalias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 2 days agomessage-square12fedilink
minus-squareh4x0r@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up8·1 day agoNo sed necessary with extglob enabled: echo ${line//@(TH|[EL ]|DO)/}
minus-squareBadabinski@kbin.earthlinkfedilinkarrow-up3·1 day agoI was waiting for someone to come along with this response lmao I’m terrible at remembering shell string operation syntax, but this is the ultimate answer.
minus-squaresik0fewl@lemmy.calinkfedilinkarrow-up2arrow-down1·1 day agoDefinitely not the ultimate, since it’s not POSIX, but still a nice tidbit.
minus-squareBadabinski@kbin.earthlinkfedilinkarrow-up3·1 day agoIdk, writing POSIX-compliant shell is so miserable that I avoid doing it when I can. You can use Bash on BSD and all other unixes, so it’s still a relatively portable solution.
minus-squaresik0fewl@lemmy.calinkfedilinkarrow-up2arrow-down1·1 day agoTrue enough, but it’s pretty much the same to use sed, unless you need those milliseconds of performance boost.
No
sednecessary withextglobenabled:echo ${line//@(TH|[EL ]|DO)/}I was waiting for someone to come along with this response lmao
I’m terrible at remembering shell string operation syntax, but this is the ultimate answer.
Definitely not the ultimate, since it’s not POSIX, but still a nice tidbit.
Idk, writing POSIX-compliant shell is so miserable that I avoid doing it when I can. You can use Bash on BSD and all other unixes, so it’s still a relatively portable solution.
True enough, but it’s pretty much the same to use sed, unless you need those milliseconds of performance boost.