C shell & Bourne Shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting C shell & Bourne Shell
# 1  
Old 02-12-2007
C shell & Bourne Shell

Hi Guys,
My first post and simple one at that .. Really rusty with this shell scripting..\
I have a script called .. j.sh
I am calling
> j.sh LOG_PATH $BLMBRGDATA/blmbrg.properties

where j.sh is grep $1 $2 | cut -d',' -f2 .

$BLMBRGDATA is set to a directory path.

why do i get :-
$ get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
get_property_value.sh: not found
$ ./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
/home/mahalja/sbclocal/dyn/data/blmbrg_pricing/log

and
why does this not work ?

$ set log_path = `./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties`
$ echo $log_path

$ set log_path `./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties`
$ echo $log_path

$

Thanks
# 2  
Old 02-12-2007
Quote:
$ set log_path = `./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties`
$ echo $log_path

$ set log_path `./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties`
$ echo $log_path
` ` - are necessarily to execute a command / script

and to the variable log_path you are assigning the result of a command or a script after executing them

so in bash if its like
Code:
var=`command`
echo $var

From the example provided I dont think they are command or a script.

Please do check that.
# 3  
Old 02-12-2007
Thanks for that .. can u please explain :-

$ ./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
/home/mahalja/sbclocal/dyn/data/blmbrg_pricing/logs
$ get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
get_property_value.sh: not found

thanks..
# 4  
Old 02-12-2007
Quote:
Originally Posted by jsm66
Thanks for that .. can u please explain :-

$ ./get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
/home/mahalja/sbclocal/dyn/data/blmbrg_pricing/logs
$ get_property_value.sh LOG_PATH $BLMBRGDATA/blmbrg.properties
get_property_value.sh: not found

thanks..

This script get_property_value.sh is executed from the directory where it is created and the directory is not available in $PATH.

Hence, get_property_value.sh when it is executed from the directory where its available, ( as ./get_property_value.sh ) the interpretor would identify that the script is available in the current directory and executes that.

But when executed as get_property_value.sh it would search for the values in the var $PATH and since its not available in the PATH env var it is displaying as not found
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Cybersecurity

'Shell Shock' vulnerability in Bourne shell

A severe vulnerability was discovered in Bourne shell. Just google for: bash vulnerability ... for more details. (5 Replies)
Discussion started by: Cochise
5 Replies

2. Shell Programming and Scripting

Bourne shell & Korn shell

Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command .. $ echo $SHELL yields me /bin/sh Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies

3. Shell Programming and Scripting

Bourne/C shell help

Exercise Five Write a Bourne shell script which: • Professionalism: plan for this from the start. • Has one command line argument. • If the command line argument is a directory then the script should output the number of files in the directory. • If the command line argument is an ordinary... (2 Replies)
Discussion started by: moesom
2 Replies

4. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

5. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

6. Shell Programming and Scripting

How to define array in Bourne shell , csh & ksh

Dear friends... Kindly if any one can help me to know the differences in definning & retreiving data from arrays in the sh,csh & ksh. I always facing problems in this issue. thanks...:) BR (3 Replies)
Discussion started by: ahmad.diab
3 Replies

7. Shell Programming and Scripting

Need Bourne shell tutorial

Hello. I need a good & complete Bourne shell tutorial. Please, can anyone help me to find it? Thanks. (1 Reply)
Discussion started by: jag
1 Replies

8. Shell Programming and Scripting

how to log if the program contains both bourne-shell & pearl scripts

I have a program (say, MyProgram) written in Bourne-shell script, but at some point it calls another script written in pearl, as illustrated below: #!/bin/sh ..... case $x in 1) ConfigSystem1 ( b-shell script) 2) ConfigSystem2 ( pl) 3) ConfigSystem3 (b-shell) .... Then I create... (0 Replies)
Discussion started by: bluemoon1
0 Replies

9. UNIX for Dummies Questions & Answers

bourne shell or korn shell?

Hi, I have a script that uses "nohup" command to execute a korn shell script. Which one is the correct shell to use bourne shell or korn shell to execute a korn shell? and why? Thanks in advanced. (2 Replies)
Discussion started by: XZOR
2 Replies

10. UNIX for Dummies Questions & Answers

Bourne-again shell

Hi guys !! well i'm still new in learning UNIX , and actually i'm still studying it by myself .. anyway, some people told me the Bourne-again shell is a good version of UNIX to work on , and i tried to download yesterday but i didn't know how to start it ...... the ReadMe file associated with... (3 Replies)
Discussion started by: mrsamer
3 Replies
Login or Register to Ask a Question