Change directory and applescript terminal command -


i have tried following cannot seem work:

do script "cd ~/desktop/test; x in ls -1 | sed -e 's/^\(.\).*/\1/' | sort -u; mv -i ${x}?* $x done" 

i'm wanting perform command in applescript. run in applescript , error regarding "" marks not sure how correct it. i'm complete newbie applescript. willing learn little lost.

thanks

note in applescript, whenever pass shell script command \, use \\ represent it.

as:

do shell script "cd ~/desktop/; x in `ls -1 | sed -e 's/^\\(.\\).*/\\1/' | sort -u`; echo ${x}?* $x; done" 

also, uses for x in `command`, instead of for x in command. it's because `` treats inside command, , expects result of command, $():

do shell script "cd ~/desktop/; x in $(ls -1 | sed -e 's/^\\(.\\).*/\\1/' | sort -u); echo ${x}?* $x; done" 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -