|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
calling self made scripts from within a script
Hello people, I'm working in the korn shell and i've come across this problem
I have a script called list which takes one argument which is working fine. Now if i write the following simple script and run it, it works fine (document is a file) Code:
#/bin/ksh list ./test/document However if i re-write it to use a variable instead like so Code:
#/bin/ksh PATH=./test/document list $PATH I get the following error scriptName[4]: list: not found Can someone please tell me how i can call the list script from within another script using a variable as the argument Cheers mike |
|
#2
|
|||
|
|||
|
Quote:
Hello, the computer always does, what you prescribe. You have rewritten the PATH variable which Unix uses to find programs you are calling. In your PATH variable was originaly the "dot" directory and after you have rewritten it, the system cannot locate the "list" command even if it is in the current directory. The remedy is simple. Use anything else than PATH, i. e. MY_PATH and the system will find your "list" command. Regards ![]() |
|
#3
|
|||
|
|||
|
I knew it would be something simple
Thanks alot mate Mike... |
|
#4
|
|||
|
|||
|
1. change #/bin/ksh
to #!/bin/ksh do you see it ? 2. echo $PATH 3. if you want all contents of all subpath use an appropriate 'sed' or 'perl' script BTW: give to the thread a usefull title calling self made scripts from within a script is just stu..d
__________________
working on Solaris[5-9], preferred languages french and C. Last edited by guggach : March 31st, 2005 at 08:14 AM. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > calling self made scripts from within a script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|