The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
bourne shell or korn shell? XZOR UNIX for Dummies Questions & Answers 2 10-06-2006 02:34 AM
Bourne-again shell mrsamer UNIX for Dummies Questions & Answers 3 09-30-2006 02:42 AM
cd from a Bourne Shell Script - Please Help fawqati Shell Programming and Scripting 10 05-25-2006 03:26 AM
Bourne Shell and Arrays Unbeliever Shell Programming and Scripting 2 07-25-2005 10:48 AM
Bourne Shell Script dmhonor914 UNIX for Dummies Questions & Answers 2 12-10-2003 12:25 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 02-12-2007
jsm66 jsm66 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 2
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 (permalink)  
Old 02-12-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
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 (permalink)  
Old 02-12-2007
jsm66 jsm66 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 2
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 (permalink)  
Old 02-12-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
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
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 10:33 AM.


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