Explore some of the more useful but perhaps more esoteric capabilities of the Bash shell with the blog post Ten More Things I Wish I'd Known About bash. It is a followup to the highly visible post by the same author on Ten Things I Wish I'd Known About bash. Modern shells like Bash, Ksh, and Zsh have over four decades of developent and refinement, making them powerful, flexlble, and fast user interfaces for efficient work — not just excellent scripting languages for automation.
(Score: 3, Interesting) by bzipitidoo on Wednesday January 24 2018, @12:00AM (2 children)
I started on Apple DOS 3.3 and MSDOS. Apple DOS is amazingly primitive-- doesn't even have a native "copy" command, instead has this utility program they called FID to do various file operations, including copy. MSDOS was much more capable, if not as powerful as bash. But it sure can be a lot easier to use. In bash I frequently do "for i in *.ext; do some_command $i ${i%.*}.foo; done" when I used to do "some_command *.ext" in MSDOS, and it worked, because so often the DOS version of the command was a little smarter about generating an appropriate name for the output file.
Heck, it's only recently that I learned of ${i%.*}. Used to use ${i:0:$((${#i}-4))}, which assumes the extension plus dot is 4 characters.
I've tried and tried to grok bison/yacc and flex/lex, but no luck. Bison hates my grammars, always complains of shift/reduce errors. It was easier to bang out a state machine in C by hand than fool endlessly with those utilities.
(Score: 0) by Anonymous Coward on Wednesday January 24 2018, @12:40AM
xargs - learn to use it. xe is nice as well
(Score: 0) by Anonymous Coward on Wednesday January 24 2018, @12:42AM
yeech, I'd pipe it through bloody sed first.