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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem Setting $PATH greengrass SUN Solaris 1 04-08-2007 12:40 AM
Help on setting path variable randomcz UNIX for Dummies Questions & Answers 4 11-15-2006 03:41 PM
Setting $PATH for a particular file...???? moxxx68 UNIX for Dummies Questions & Answers 4 10-08-2004 04:23 AM
Setting path for GCC? HOUSCOUS UNIX for Dummies Questions & Answers 2 09-17-2003 12:44 AM
Global PATH setting jxh UNIX for Dummies Questions & Answers 5 07-20-2001 06:23 PM

Closed Thread
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 01-17-2007
radhika03 radhika03 is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 18
Setting path

Hi all,

I have a java command in a shell script.
When i m executing the command from the prompt its working fine. But when i paste the same command in a shell script and execute the shell script it says path not found. Please help.
  #2 (permalink)  
Old 01-17-2007
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
Quote:
Originally Posted by radhika03
Hi all,

I have a java command in a shell script.
When i m executing the command from the prompt its working fine. But when i paste the same command in a shell script and execute the shell script it says path not found. Please help.
Try to use absolute path while you are trying to run the command thru shell script.
  #3 (permalink)  
Old 01-17-2007
radhika03 radhika03 is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 18
Hi,

But i dont want to use absolute path in my shell script as the folder structure may change
  #4 (permalink)  
Old 01-17-2007
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
Quote:
Originally Posted by radhika03
Hi,

But i dont want to use absolute path in my shell script as the folder structure may change
Can you show us then what you are putting in your script to run the command and the path of your command and shell script?
  #5 (permalink)  
Old 01-21-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
Are you running this script as a cron job?

Cause in that case you will have a very limited PATH definition and you will have to define PATH in the proper way.
  #6 (permalink)  
Old 01-22-2007
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
Set the PATH

Like sb008 said, set the PATH variable to point to the directory where the java executable is located. Then if the executable name is unique, it should be executed without issues. For more info search the forums.
Closed Thread

Bookmarks

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 02:53 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