The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to launch a script from the emacs minibuffer? vero_81 UNIX for Dummies Questions & Answers 0 06-10-2009 05:22 AM
launch vnc session from unix shell script a1_win Shell Programming and Scripting 0 06-05-2009 02:27 PM
Creation of a script to launch several programs j.middlefinger UNIX for Dummies Questions & Answers 3 02-18-2008 04:09 PM
How to launch a Csh shell script using Excel Macro ? Raynon Shell Programming and Scripting 1 11-08-2006 12:22 PM
Script to launch terminal window? omerta SUN Solaris 5 06-30-2005 05:48 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-23-2009
Grizzly Grizzly is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 28
Launch Script

Hi all! I just got done writing a script. The problem Im running into is I have to lanuch the script with:

Code:
sh SCRIPT.sh
Is there a way to launch it with by just entering

Code:
SCIPT
into the shell?
  #2 (permalink)  
Old 09-23-2009
varontron varontron is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 110
if you make the script executable you can launch it from it's own directory like this:

./SCRIPT.sh

if you put its directory in your PATH, you can launch it from anywhere like this:

SCRIPT.sh

If you want to launch it like this:

SCRIPT

you have to rename it (and it's directory has to be in the PATH):

mv SCRIPT.sh SCRIPT
  #3 (permalink)  
Old 09-24-2009
Scrutinizer Scrutinizer is online now
Registered User
  
 

Join Date: Nov 2008
Posts: 642
And it is best to put a shebang on the first line of your script e.g.
Code:
#!/bin/sh
or e.g.
Code:
#!/bin/ksh
Then the script will always be run with that particular shell, no matter what parent shell it was called from...
  #4 (permalink)  
Old 09-24-2009
Grizzly Grizzly is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 28
Thanks!
Reply

Bookmarks

Tags
bash, launch, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0