Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 03-31-2002, 09:26 AM   #1
Han_Solo
Prospect
 
Join Date: Jan 2002
Posts: 11
Question Scripting

I've read the above but I can't get my script to work.

I actually want to write a script that will connect to s database via ssh and do a sql dump.

However as I'm still getting my feet wet, I thought I'd try something simple first.

#!/bin/sh

echo "This script is executing"


########


unfortunately, whenever I run the

% runscript

I get

runscript: Command not found.



I've done the rehash, chmod etc. But it still doesn't work...

Any help is welcome.

Han_Solo

PS: I'm saving up for OS X Unleashed....
Han_Solo is offline   Reply With Quote
Old 03-31-2002, 10:33 AM   #2
didde
Prospect
 
Join Date: Jan 2002
Posts: 39
run script?

I'm sure you're trying to start the script like this:

"sh yourScript.sh"

.. if not, give it a try.
didde is offline   Reply With Quote
Old 03-31-2002, 11:15 PM   #3
Titanium Man
Guest
 
Posts: n/a
I'm new to scripting too, but is your script in your path? If you do this:

echo $path

or

echo $PATH

(depending on your shell) you'll get a list of places the script can be put for it to be recognized. Or you could just execute your script thusly:

./runscript

if you're in the same directory as your script. Let us know how things work out.
  Reply With Quote
Old 04-01-2002, 01:08 AM   #4
Han_Solo
Prospect
 
Join Date: Jan 2002
Posts: 11
Working.

Don't know what I did, but it did work...


Thanks
Han_Solo is offline   Reply With Quote
Old 04-01-2002, 10:43 AM   #5
chug
Prospect
 
Join Date: Mar 2002
Location: Australia
Posts: 33
Make a dir called bin in your users dir and then mv the script into that dir. You can then type the name of your script as if it was a command.

Make sure you check to see if there are any other commands with the same name. if so, change it to something that is not in use.

So if you call it comp.. type comp and then <tab> to see what other commands are around with the name comp. If so, add some more compmail <tab> and see if that is free.. And so on untill you have something that works.

__________________
Cheers
chug is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.