• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
do shell script - which shell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script - which shell?


  • Subject: do shell script - which shell?
  • From: Chris Garaffa <email@hidden>
  • Date: Sat, 06 Apr 2002 16:03:09 -0500

Hello all,

I've got a little script to manipulate Apache via the apachectl command:

--script beginning--
on run
set apache_action_list to {"Start", "Stop", "Restart", "Graceful
Restart"}
set apache_action to choose from list apache_action_list with
prompt "Do what to Apache?" without multiple selections allowed and
empty selection allowed
set apache_action_str to apache_action as string
(*display dialog apache_action_str*)
if apache_action_str is equal to "Start" then
do shell script "apachectl start"
display dialog "Apache started"
end if
if apache_action_str is equal to "Stop" then
do shell script "apachectl stop"
display dialog "Apache stopped"
end if
if apache_action_str is equal to "Restart" then
do shell script "apachectl restart"
display dialog "Apache restarted"
end if
if apache_action_str is equal to "Graceful Restart" then
do shell script "apachectl graceful"
display dialog "Apache gracefully restarted"
end if
end run
--script end--

Well, I get the error
"zsh: command not found: apachectl"

However, I don't use zsh! My preferred shell in Terminal is tcsh, and it
is set that way...
I tried adding this line to the beginning of my script:
do script "tcsh"
with no results...

Should I run this through Terminal, as in,
if apache_action_str is equal to "Start" then
tell application Terminal
do script with command "apachectl start"
end tell
end if

I don't want to have Teminal starting, though, because I plan to put
this in the Script Menu, and it seems a bit too intrusive to have
Terminal opening up windows and such...

Any ideas?

Thanks,
Chris
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: do shell script - which shell?
      • From: Adrian <email@hidden>
  • Prev by Date: Re: as alias list broken in OSX?
  • Next by Date: Terminal scripting
  • Previous by thread: Re: as alias list broken in OSX?
  • Next by thread: Re: do shell script - which shell?
  • Index(es):
    • Date
    • Thread