Re: Copy folder shell scripting
Re: Copy folder shell scripting
- Subject: Re: Copy folder shell scripting
- From: Christopher Nebel <email@hidden>
- Date: Thu, 24 Apr 2008 13:36:13 -0700
On Apr 24, 2008, at 12:59 PM, Bruce Robertson wrote:
On Apr 24, 2008, at 7:35 AM, Mark J. Reed wrote:
You can put any kind of interpreter name after the #! and it will
work,. for instance
#!/usr/bin/osascript
path to me
works (at least on Leopard; a niggling memory is telling me that you
might have to add an option after the /osascript to get it to work
on
earlier versions of OS X).
Actually, it just doesn't work in earlier versions. It's possible to
fake it, though; here's one way:
#!/bin/sh
osascript - "$@" <<EOF
your script here
EOF
I tried that like this. I know this particular example is kinda
going the
long way around but I'm just trying to see how it works. This is on
10.4.11.
#!/bin/sh
osascript - "$@" <<EOF
do shell script "ls"
EOF
And got this result in Terminal but I don't know what workspacegns
means.
[ip133:~] bruce% /Users/bruce/Desktop/osaText.sh
workspacegns
It's an artifact of how "do shell script" returns its output -- it
uses \r for line breaks, which means that in Terminal, all the lines
print on top of each other, and you see a mish-mash of all of them.
In the particular case of "do shell script", you can add "without
altering line endings", or pipe everything through "tr \r \n".
--Chris Nebel
AppleScript Engineering
P.S.: The '- "$@"' is to pass any parameters from the command line
through to osascript. If you're not using parameters, then you don't
need it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden