Welcome to MacForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

launching shell scripts (bash) from OS X 10.3 from the des..

 
   Macintosh computer (Home) -> General Discussion RSS
Related Topics:
Executing bash scripts by double-clicking - Hi, I'm trying to execute a bash shell script by on the file. I've made sure that it's (chmod 777), and I've tried appending to the end of the file. When it's when I the script is..

Starting UNIX shell scripts (10.3.2) - Hi there, I'm running Panther and have some question about UNIX shell scripts: - When I make files by choosing as the default the shell script is run, but the newly opened Terminal window is not..

GUI prompt for sudo password in shell scripts? - PGP SIGNED Hash: SHA1 Subject says it all. Possible? - -- Anthony Chavez PGP..

BASH question - I'd like to copy files from: from my .mac iDisk to on my iMac. I want to keep the time-date stamp, and not copy files with a newer time-date stamp on the ..

Where are init scripts for OSX - I'm asking this question from a Linux so forgive me if is not quite right: Where are the daemon startup scripts kept and if I were to create my own daemon how, would I go about getting it launched at system startup? Thanks
Next:  Deimos Rising?  
Author Message
Dino

External


Since: Feb 07, 2004
Posts: 15



(Msg. 1) Posted: Sun Feb 29, 2004 1:50 am
Post subject: launching shell scripts (bash) from OS X 10.3 from the deskt
Archived from groups: comp>sys>mac>misc (more info?)

hello,

i've created some shell scripts (bash, OS X 10.3) to automatically retrieve
backup-files from different webservers and copy them to my local HD. this
works fine, but i have to start them from the terminal window by typing "sh
[myscript]".

is there a way to launch them directly from the desktop or dock by double
click?

thanks + best regards,
dino

 >> Stay informed about: launching shell scripts (bash) from OS X 10.3 from the des.. 
Back to top
Login to vote
Moray Taylor

External


Since: Feb 27, 2004
Posts: 6



(Msg. 2) Posted: Sun Feb 29, 2004 1:50 am
Post subject: Re: launching shell scripts (bash) from OS X 10.3 from the d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-02-28 21:50:05 +0000, Dino <nospam.TakeThisOut@yahoo.com> said:

 > hello,
 >
 > i've created some shell scripts (bash, OS X 10.3) to automatically
 > retrieve backup-files from different webservers and copy them to my
 > local HD. this works fine, but i have to start them from the terminal
 > window by typing "sh [myscript]".
 > is there a way to launch them directly from the desktop or dock by
 > double click?
 > thanks + best regards,
 > dino

The easist way is to use an AppleScript Applet thingie, open 'Script
Editor', type...

do shell script "sh [Path to MyScript]"

Save as an application, and your done.

Cheers

Moray<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: launching shell scripts (bash) from OS X 10.3 from the des.. 
Back to top
Login to vote
Dave Seaman

External


Since: Jun 25, 2003
Posts: 592



(Msg. 3) Posted: Sun Feb 29, 2004 1:50 am
Post subject: Re: launching shell scripts (bash) from OS X 10.3 from the d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 28 Feb 2004 22:50:05 +0100, Dino wrote:
 > hello,

 > i've created some shell scripts (bash, OS X 10.3) to automatically retrieve
 > backup-files from different webservers and copy them to my local HD. this
 > works fine, but i have to start them from the terminal window by typing "sh
 > [myscript]".

If you are typing "sh [myscript]" then you are running the script in
Bourne shell (sh), rather than bash. It probably doesn't matter, unless
you want to use some specific features of bash in your script.

 > is there a way to launch them directly from the desktop or dock by double
 > click?

Give your script a suffix of ".command". Then make it executable by
typing

  chmod +x [myscript].command

Now you can double-click to run the script, but it will still open a
Terminal window for you, which you can close when it is finished.

If you really want your script to run in bash, add the line

  #!/bin/bash

at the beginning of the script.


--
Dave Seaman
Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling.
<http://www.commoncouragepress.com/index.cfm?action=book&bookid=228><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: launching shell scripts (bash) from OS X 10.3 from the des.. 
Back to top
Login to vote
Dino

External


Since: Feb 07, 2004
Posts: 15



(Msg. 4) Posted: Sun Feb 29, 2004 1:01 pm
Post subject: Re: launching shell scripts (bash) from OS X 10.3 from the d [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 28 Feb 2004 23:26:08 +0100, Dave Seaman wrote
(in message <c1r4i0$gtr$1@mozo.cc.purdue.edu>):

 > Give your script a suffix of ".command". Then make it executable by
 > typing
 >
  > chmod +x [myscript].command
 >
 > Now you can double-click to run the script, but it will still open a
 > Terminal window for you, which you can close when it is finished.
 >
 > If you really want your script to run in bash, add the line
 >
  > #!/bin/bash
 >
 > at the beginning of the script.
 >
 >

thanks! works perfectly now...... :-)))<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: launching shell scripts (bash) from OS X 10.3 from the des.. 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]