I need to make it so the files in current directory get amended with a timestamp. It works fine for the first time, but once I run it again it adds another timestamp to the file. I need a way to replace the timestamp, not just add to it.
#!/bin/sh IFS=' ' time=$(date) for file in * do mv $file "$file""$time" done
I'm trying to think of how to overwrite the old files, but because the name changes when it gets amended with the timestamp I can't think of a way.