The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Put a \ in front of special characters in SED tugger Shell Programming and Scripting 9 10-17-2007 04:12 AM
Running exe's from front end Sinbad High Level Programming 0 09-13-2004 06:33 AM
Front end on Unix shibz UNIX for Advanced & Expert Users 4 11-17-2001 08:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2006
Registered User
 

Join Date: Mar 2006
Posts: 1
run script with ./ in front of name

on unix AIX5.3, we run a scripts by entering the
script name on the command line and sometimes
we get a not found error and then we put ./ in front on the name
and it runs.
Why?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-09-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
check your '$PATH' environment variable - it probably doesn't have '.'
Reply With Quote
  #3 (permalink)  
Old 03-09-2006
Registered User
 

Join Date: Feb 2005
Location: Canada
Posts: 131
You can also try:
Code:
sh yourprog
but as VGERSH99 said, you should add that directory to the PATH variable.
Reply With Quote
  #4 (permalink)  
Old 03-10-2006
Registered User
 

Join Date: Mar 2006
Posts: 2
rig,
when u run script by just entering the script name, the shell finds the script in paths/location as defined in the $PATH variable.

The reason why the script failed is because your current directory is not defined in the PATh varibale. But when you run script as ./script_name then the shell gets the location of the script as ' . ' ( i.e. yuor current directory )
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0