All of the following posts share a tag, and are related to that subject.
If you would like to try another subject, you can pick from the
available tags.
Defining bash functions inside functions
I tend to do a lot of things with some terrible, terrible bash scripts. Backups,
listening to music, creating temporary virtual machines... and also, listening through
my podcast backlog. This last one gets pretty complicated, and while looking
into how to manage it, I discovered a bash script technique that surprised me.
Bash while loop only getting the first value of a file
Occasionally, due to circumstances entirely within my control, I find myself in
an odd situation. Bumping into edge cases, doing things the hard way... for
whatever reason, I seem to have a knack for finding the approach with the most
exotic issues. What follows, is one of these scenarios.
It turns out, the mpv media player (one of my all-time favorite utilities) can play media files located inside of a compressed archive. If you have a bunch of FLAC files in a zip archive, and tell mpv to play that zip archive... it just does.
I use rsync to back up many servers and other machines. Because of my very
different sources and targets, I have a collection of very complex bash scripts
that manage these backups. When I moved one stage of these backups to a new
server, it started behaving strangely - and it was difficult to discover why.
After creating a whole host of backup DVDs, you might be faced with a dilema;
how to verify that each disk was burned properly. Backups aren't backups until
they are tested!
Whitespace causes lots of interesting issues with the command line - whether
it is present in file names, arguments, or any other data flowing between
commands. Quoting can help, but there's some very particular edge cases I've
encountered in my scripts.