path problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users path problem
# 1  
Old 02-22-2006
Data path problem

Hi

i am writing a script containing processing commands which are reside in /opt/terascan/bin dir. if i run the script from command prompt it is working fine. but in crontab it is not working.

if i give env command from command prompt it is showing /opt/terascan/bin dir in PATH variable.

and the same env command if i put it script and run a crontab it is not working.

i shuld add /opt/terascan/bin dir path in my script.

how it is possible.

please help

thanks in advance
# 2  
Old 02-22-2006
Just to be sure, set the PATH in your script. For any sh-style script, just add the line:
Code:
PATH=/opt/terascan/bin:$PATH; export PATH

For csh scripts, use:
Code:
set path=(/opt/terascan/bin $PATH)

Its just one line...

Last edited by blowtorch; 02-22-2006 at 10:30 AM..
# 3  
Old 02-23-2006
yes blowtorch,

thanks for your code.

it is partially working

please see my sh script

#! /bin/sh -f
#PATH=/opt/terascan/bin; export PATH
PATH=/opt/terascan/bin:$PATH; export PATH
ls -l > list
lspass > pas
peekauto > schedule \
num_days = '1' \

above script i run with crontab

but the error coming like this

satsetup: SATDATA undefined
satsetup: SATDATA undefined

please help
# 4  
Old 02-23-2006
Quote:
Originally Posted by rajan_ka1
yes blowtorch,

thanks for your code.

it is partially working

please see my sh script

#! /bin/sh -f
#PATH=/opt/terascan/bin; export PATH
PATH=/opt/terascan/bin:$PATH; export PATH
ls -l > list
lspass > pas
peekauto > schedule \
num_days = '1' \

above script i run with crontab

but the error coming like this

satsetup: SATDATA undefined
satsetup: SATDATA undefined

please help


dear blowtorch,

i have run the script from command line using
sh test.sh command
but the error
PRM error. Parameter with no name found on command line.
is coming

please rectify this
# 5  
Old 02-23-2006
From that error, it looks like the script needs more than just the PATH to be set. An environment variable called SATDATA might also be required to be set to an appropriate value. You are using lspass and peekauto which seem to be terascan commands. Can you check if any of them further call satsetup or directly use a variable SATDATA?
# 6  
Old 02-24-2006
dear blowtorch,

thanks for your reply.

SATDATA env variable path is /opt/terascan/pass/satel dir
my i define this path to SATDATA in my script.

then please give me the syntax of this how to define SATDATA.

waiting for reply.
# 7  
Old 02-24-2006
Since you are using sh for the script, you need to do this:
Code:
SATDATA=/opt/terascan/pass/satel; export SATDATA

Do this before you run those commands.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

PATH problem

For the sake of not going insane and not buggering a load of needed system stuff, I have created a dir /mybin. (This is a Debian system.) I have then edited the /etc/profile and /etc/login.defs files and added :/mybin to all of the path variables. I have the file /mybin/mtp for... (2 Replies)
Discussion started by: MuntyScrunt
2 Replies

2. Shell Programming and Scripting

Problem with PATH

Recently I lost a number of changes I made to a program when the SCO Unix system went down. The system "mail" suggested a "vi -r" option that took me back several days. To prevent this in the future, I am trying to create my own vi command: if then cp -p $1 $1.bak fi /usr/bin/vi $* if ... (5 Replies)
Discussion started by: wbport
5 Replies

3. Shell Programming and Scripting

Problem with spaces in the path

Hi all, I have a variable test has the following value assigned.. could you please help on doing cd or ls to the value in the varible ... $echo $test /bdm/sdd/compounds/AD4833XT/requests/clin/Watson_20090420/docs/MHRA\ Comments\ \&\ Responses $cd $test ksh: cd: bad argument count $cd... (3 Replies)
Discussion started by: firestar
3 Replies

4. Shell Programming and Scripting

if PATH contains a certain string problem!

Hi I am using MKS Toolkit c shell. I want to basically check if my PATH variable already contains a certain path directory so I tried this (it didnt work!): if: Expression Syntax if ( echo $path |grep -c c:/PROGRA~1/blah/blah ) then please help me get this little statement to work. ... (3 Replies)
Discussion started by: vas28r13
3 Replies

5. Infrastructure Monitoring

Problem with PATH

On one of the machines at work, we had Net-SNMP 5.2.3 installed, and I wanted to upgrade that to 5.4.2.1. So I downloaded the tar file, extracted it, did the configure, make, make test, make install, and everything worked. All the executable files (like snmpget, snmpset, snmpwalk) got copied to... (1 Reply)
Discussion started by: sllinux
1 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. Shell Programming and Scripting

Problem with File path

How to pass a file path to open a file? I am using cygwin. I want to open a file from a particular path, say C:\Test\File1,. This file path is stored in a variable. I am able to cat a file like this : cat "c:\Test\File1" but i want the same thing to happen in my script file through a variable... (3 Replies)
Discussion started by: sandeep_hi
3 Replies

8. Shell Programming and Scripting

path problem

hi , i have written csh script i am unable to set PATH variable in my script. my script is like this ===================================== # ! /bin/csh -f setenv PATH "$PATH:/opt/terascan/bin" ls -l > list lspass > pas peekauto > schedule \ num_days = 1 \ exit 0... (1 Reply)
Discussion started by: rajan_ka1
1 Replies

9. UNIX for Dummies Questions & Answers

cc path problem - no acceptable path found

Hello everyone, I'm a unix noob. I have a powerbook running mac os x 10.4 and for one of my classes I need to install the latest version of php (5.0.5). I'm following the instructions at http://developer.apple.com/internet/opensource/php.html to install but I've run into a problem. The... (2 Replies)
Discussion started by: kendokendokendo
2 Replies

10. Shell Programming and Scripting

PATH variable problem

root->echo $PATH /usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin root->find / -name gcc /usr/local/bin/gcc /usr/local/doc/gcc root->which gcc no gcc in /usr/sbin /usr/bin Why cant it find gcc - the path looks okay doesnt it? I am running solaris 9 - and... (7 Replies)
Discussion started by: frustrated1
7 Replies
Login or Register to Ask a Question