Just another stupid yet handy one-liner I came up with while doing nothing useful.
I was sitting in front of a shell, wondering why some files in some directory existed with three different extensions while others didn’t, when it hit me that all files should exist with three different extensions for something altogether different to work. Instead of manually touch‘ing all those files that didn’t exist with all three different extensions, I farted the following BASH one-liner.
for i in *.frm; do base=$(echo $i | sed s/.frm$//); if [ ! -f $base.MYD ] && [ ! -f $base.MYI ]; then touch $base.MY{D,I}; fi; done
;-) The fact that my initial speculation that doing so would get something altogether different to work failed miserably is irrelevant.