Re: Shell Scripting
Re: Shell Scripting
- Subject: Re: Shell Scripting
- From: Kevin Muldoon <email@hidden>
- Date: Tue, 24 Sep 2002 12:56:04 -0500
Unix Power Tools? Cool! In fact, I've answered my own question.
#1) Save your text as UNIX from BBEdit. Script won't work otherwise.
#2) enclose your command line statement (in this case, whoami) with a
'Grave Accent' (same key as the tilde, but without shift key).
One last question! WHERE is the best place to put this script on your
system so it can be accessed?
############## START SCRIPT ######################
#!/bin/sh
# Use the echo command to print
# hello world.
echo Hello World
# Use the echo and whoami commands
# with command substitution to
# print the username.
echo I am `whoami`
############## END SCRIPT ######################
On Tuesday, September 24, 2002, at 10:52 AM, bill fancher wrote:
>
>
On Tuesday, September 24, 2002, at 08:40 AM, Kevin Muldoon wrote:
>
>
> OK, you're right. 'whoami' is useless.
>
>
whoami is very useful. 'echo whoami' is not really "totally useless"
>
(it might be useful in some situations) but it doesn't execute whoami,
>
which is what I thought you were trying to do.
>
>
> The real question is how do you echo the result of a UNIX command?
>
>
Not sure what you mean by "echo the result". Do you mean "get the
>
result of a do shell script command into an AppleScript variable"? If
>
so:
>
>
set listing to (do shell script "whoami")
>
>
> All attempts are not working so far. Once again, a fully written
>
> script is best.
>
>
Once again, it's not clear what you're asking for. A fully written
>
script that does what?
>
>
--
>
bill
>
>
>
> Eventually, I would like to get familiar enough with Tcsh scripts
>
> that I can use AppleScript to call them. Particularly, I'd like to
>
> use the ftp features of UNIX via AppleScript (but that is down the
>
> road).
>
>
>
> Thanks.
>
>
>
>
>
> On Tuesday, September 24, 2002, at 10:23 AM, bill fancher wrote:
>
>
>
>>
>
>> On Tuesday, September 24, 2002, at 06:33 AM, Kevin Muldoon wrote:
>
>>
>
>>> Great! Made my first Tsch shell script! Now, how do I make it do
>
>>> something useful like 'echo whoami'?
>
>>
>
>> %% echo whoami
>
>> whoami
>
>>
>
>> Fully expected and totally useless.
>
>>
>
>>> A fully typed and working example would be appreciated. (Now that
>
>>> we can call shell scripts in AppleScript, the question is >>>> relevant!)
>
>>
>
>> Perhaps, but I have no idea what the question IS. Could you say a
>
>> little more about what you're trying to do?
>
>>
>
>> --
>
>> bill
>
>>
>
>>> _______________________________________________
>
>>> applescript-users mailing list | email@hidden
>
>>> Help/Unsubscribe/Archives:
>
>>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>>> Do not post admin requests to the list. They will be ignored.
>
>>>
>
>>
>
>>
>
> Kevin Muldoon
>
> Systems Integrator
>
> CPS Group
>
> 6555 Sierra Dr.
>
> Irving, Texas 75039
>
> wk. 972.830.2851
>
> fx. 972.830.1378
>
>
Kevin Muldoon
Systems Integrator
CPS Group
6555 Sierra Dr.
Irving, Texas 75039
wk. 972.830.2851
fx. 972.830.1378
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.