You are not logged in.
#!/bin/bash
addtofile="$1"
for file in *
do
if [ ! -e !"$addtofile$file" ]
then
mv "$file" "$addtofile$file";
fi
done
prefix adds a prefix to all the files in a directory. Use it as so:
$ prefix "prepended string"
Now I'm sure with tweaking you can get it to prefix only a single file, only certain files, etc, but I wrote this mainly for adding prefixes to large numbers of files.
Personally, I'd rather be back in Hobbiton.
Offline
Or just use zsh and "zmv -W '*' 'prefix*'" (didn't test it but something similar should work)
Offline
I use rename for stuff like that. Also, have a look at moreutils
Offline
Thanks for the contribution.
Howver, you should use a more suitable thread title, or post in a more suitable place. If you are serious about having this included in coreutils, there's no point posting it here - send it to the coreutils devs for their consideration.
Offline