Is it possible, in Linux, to rename a file from something without spaces to something containing spaces?
I know I can create directories and files with spaces by doing:
mkdir "new dir" and:
touch "new file.txt"
I want to rename files from:
imgp0882.jpg to something like:
20091231 1243 some topic.jpg
And how would it look in a shell script that uses parameters like:
for i in *.jpg do
rename "$i" "$somepath/$mydate $mytime $mytopic$extension"
?
A little background:
- I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming.
- If you want to see my script, here's a copy.
- I'm not using
jheadfor this renaming because that only works with JPEG files but I want a single solution for any media format including videos.