Setting path


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Setting path
# 1  
Old 01-17-2007
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  
Old 01-17-2007
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  
Old 01-17-2007
Hi,

But i dont want to use absolute path in my shell script as the folder structure may change
# 4  
Old 01-17-2007
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  
Old 01-21-2007
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  
Old 01-22-2007
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Setting class path

hi , can anybody help me to chage the class path in unix server.. what are the files need to update .... (2 Replies)
Discussion started by: Madhu Siddula
2 Replies

2. UNIX for Dummies Questions & Answers

Is there any $PATH default setting?

This is a very newbie's question: I was trying to add a new version of the same command "blastn", but the old command always shows up first. which blastn /usr/local/bin/blastnThe two versions of the same command "blastn" are located in: which -a blastn /usr/local/bin/blastn... (5 Replies)
Discussion started by: yifangt
5 Replies

3. UNIX for Dummies Questions & Answers

Setting up a private path

Hi all, This is probably a very simple question but I couldn't even think of how to phrase it intelligently so google could tell me the answer. Basically I am a user on a server, I am not the admin and do not have root privileges. I have downloaded a bunch of programs that I need to use and... (2 Replies)
Discussion started by: DavyK1984
2 Replies

4. Shell Programming and Scripting

Setting path names

I am in a directory called /abstracts Doing tree -d gives . ├── geo1936 │ ├── geo01n01 │ ├── geo01n02 │ └── geo01n03 ├── geo1937 │ ├── geo02n01 │ ├── geo02n02 │ ├── geo02n03 │ └── geo02n04 (4 Replies)
Discussion started by: kristinu
4 Replies

5. Solaris

Setting PATH - Vanishes

Hi , I new to solaris. I want to set path variable . Eg: JAVA_HOME. When i do this, #JAVA_HOME=/usr/jdk/jdk1.6 #export JAVA_HOME #echo $JAVA_HOME /usr/jdk/jdk1.6 Then its ok. When i toggle to bourne shell or if i log off or restart. then JAVA_HOME is echoed blank. How to set... (4 Replies)
Discussion started by: gnanagurus
4 Replies

6. Solaris

Problem Setting $PATH

I am trying to install the pkg-get package to a fresh install of Solaris 10. I am able to download and install correctly using the default directory for both pkg-get and wget as found on blastwave.org. When I issue the command "which wget and which pkg-get" it returns no wget or pkg-get found in... (1 Reply)
Discussion started by: greengrass
1 Replies

7. UNIX for Dummies Questions & Answers

Help on setting path variable

Hi there, I need help on setting the path variable. How can I set the path variable with Bourne Shell. My scripts goes like this, but did not work. #!/bin/sh PATH=/usr/bin:/usr/ucb:/etc:/export/home/zchen/home export PATH Thanks, Z (4 Replies)
Discussion started by: randomcz
4 Replies

8. UNIX for Dummies Questions & Answers

Setting path for GCC?

Dear all, I have downloaded the latest version of gcc --- gcc-3.3.1.tar.gz from gnu.org. My Linux distribution is Mandrake 9.0. This was how I installed it: su - passwrd: mkdir /usr/local/src cd /usr/local/src gunzip /tmp/gcc-3.3.1.tar.gz #where I downloaded the file tar xvf... (2 Replies)
Discussion started by: HOUSCOUS
2 Replies

9. UNIX for Dummies Questions & Answers

Global PATH setting

I am using Solaris 8 and I want to change the PATH setting for all users. I have edited /etc/profile, but when I log in and check the PATH variable, it hasn't changed. Am I missing something? (5 Replies)
Discussion started by: jxh
5 Replies
Login or Register to Ask a Question