Do Shell Script to change file extensions

Hello All,

I currently have a shell script which I run through automator that looks like this:

cd /Users/home/Documents
for file in *.log ; do mv $file echo $file | sed 's/\(.*\.\)log/\1csv/' ; done

I would like to move this to a script and perform the same function. This shell script changes the file extension from .log to .csv

What do I need to change to incorporate this into my script?

Thanks
tringo19

do shell script “your commands” escaping characters that need to be… so give this a try

[untested]

do shell script "cd /Users/home/Documents; for file in *.log ; do mv $file `echo $file | sed 's/\\(.*\\.\\)log/\\1csv/'` ; done"

perfect, james. worked like a champ!