Here’s a bash function that you can throw in your .bashrc and use more easily:
#!/bin/bash
# Put this in your ~/.bashrc and use it like a script...
append_filename() {
USAGE="append: Puts text between filename and extension"
USAGE="$USAGE\nUsage: $0 APPENDAGE file1 file2 file3 ..."
if [ "$#" == "0" ]; then
echo -e "$USAGE"
return 1 # exit kills shell this is called from
fi
# get appended string
APPENDAGE=$1
shift
while (( "$#" )); do
if [ -f "$1" ]; then # don't rename directories
mv "$1" "${1%.*}$APPENDAGE.${1##*.}"
fi
shift # grab the next file in list
done
}
I had a group of files that I needed to append a suffix to, but leave the extension intact. Basically, I needed to split the filename and extension, then put them back together with some filling in the middle…
Was messing around the last couple of days with my guitar, and got a little too close to the electronics bench…
I ended up with the following small amp circuits (I say small, but these things are louder than shit through a 1×12 cabinet):
Here’s a pic of the bridged circuit on the breadboard:
Anyways, waiting for some JFETs in the mail so I can wire up some proper preamps.
These closely follow the the example circuits in the datasheet, but many thanks to runoffgroove.com for the great examples – particularly the little gem designs.
If you got a file or group of files to put on a removable drive with a FAT32 file system – and any of them are over 4GB – then you need a way to make it smaller for transport. The easiest way is with split, cat and tar.