Re: Appending the file modified date to the file name

2015-12-01 Thread Ian Malone
On 1 December 2015 at 02:30, Gordon Messmer wrote: > On 11/30/2015 04:49 PM, Robert Moskowitz wrote: >>> >>> You could: >>> mv "$file" "$file-$(stat -c %y "$file")" >> >> >> Not quite as the script: >> >> #!/bin/bash >> for i in `seq 20 42`; >> do >> file="Voice "0${i}.m4a >>

Re: Appending the file modified date to the file name

2015-11-30 Thread Gordon Messmer
On 11/30/2015 04:49 PM, Robert Moskowitz wrote: You could: mv "$file" "$file-$(stat -c %y "$file")" Not quite as the script: #!/bin/bash for i in `seq 20 42`; do file="Voice "0${i}.m4a mv $file "$file-$(stat -c %y "$file")" done is producing: mv: target ‘Voice 03

Solved - Re: Appending the file modified date to the file name

2015-11-30 Thread Robert Moskowitz
Here is what works: #!/bin/bash for i in `seq 20 42`; do file="Voice "0${i}.m4a mv "$file" "$file-$(stat -c %y "$file"|awk '{print $1}')" done I suspect there are better ways, but this will do for now... thanks On 11/30/2015 07:49 PM, Robert Moskowitz wrote: On 11/30

Re: Appending the file modified date to the file name

2015-11-30 Thread Robert Moskowitz
On 11/30/2015 07:21 PM, Gordon Messmer wrote: On 11/30/2015 03:50 PM, Robert Moskowitz wrote: Now I want to rename these files, which are all lectures to have the date of creation/lastmodified in the file name. Does the date require a specific format? You could: mv "$file" "$file-$(stat -

Re: Appending the file modified date to the file name

2015-11-30 Thread Gordon Messmer
On 11/30/2015 03:50 PM, Robert Moskowitz wrote: Now I want to rename these files, which are all lectures to have the date of creation/lastmodified in the file name. Does the date require a specific format? You could: mv "$file" "$file-$(stat -c %y "$file")" Or if you want to define your own

Re: Appending the file modified date to the file name

2015-11-30 Thread mike
On 11/30/2015 03:50 PM, Robert Moskowitz wrote: I am pulling a bunch of recordings off my android phone. I found simple-mtpfs to be able to use 'cp -a' to actually copy the files and preserve their date information. Now I want to rename these files, which are all lectures to have the date of cr

Appending the file modified date to the file name

2015-11-30 Thread Robert Moskowitz
I am pulling a bunch of recordings off my android phone. I found simple-mtpfs to be able to use 'cp -a' to actually copy the files and preserve their date information. Now I want to rename these files, which are all lectures to have the date of creation/lastmodified in the file name. All my