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
unable to log into gdm, urgent help needed!!!pls wrapster Shell Programming and Scripting 0 04-25-2008 12:48 AM
urgent needed manish1 Shell Programming and Scripting 0 03-13-2008 05:09 AM
Urgent help needed skyineyes UNIX for Dummies Questions & Answers 5 06-19-2007 03:31 AM
urgent help needed !! guhas Shell Programming and Scripting 0 09-10-2005 01:01 PM
Urgent Help needed mgchato High Level Programming 0 05-19-2005 02:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-07-2006
Batch Batch is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 3
urgent help needed.

Ok I admit it I am stumped and I would appreciate any and all help

Here is what I am trying to do.

Korn Shell script

I am setting a variable to another shell script that I want to invoke in my main script like so:

GETDIR=/vol100/cfg/.getdir

The .getdir shell script take a parameter, for example:

./getdir somedir

This returns a single entry.

I set another variable in the main script to the parameter
PARAM=someparameter

Now inside my main script I want to get the result of running the .getdir script with the parameter

And I am trying to do this like so

NETDIR=$(${GETDIR} ${PARAM})
echo ${NETDIR}

But it doesn't work ${NETDIR} is always empty.

Any suggestions?

Thanks,

Batch
  #2 (permalink)  
Old 12-07-2006
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
First , is the name of the script you are calling .getdir or just getdir? Your example command says ./getdir somedir, but you refer to it as .getdir in your variable and comment.
If that's just a typo, it looks to me that there may be a discrepancy on what getdir does and/or takes as input and what you are asking it to do. In your example, getdir takes a directory as input, but in your script, you pass a parameter. Is this parameter a directory? Maybe getdir expecting a path and your parameter is just a name (or vise versa)?

This part has the proper syntax to work:
Code:
NETDIR=$(${GETDIR} ${PARAM})
echo ${NETDIR}
  #3 (permalink)  
Old 12-07-2006
Batch Batch is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 3
Sorry it is a hidden file so it is .getdir And the parameter that it takes is just a hashed value of some text and the .getdir script unhashes it.

When I run the .getdir script in the console with the parameter it works fine. But as I said it doesnt seem to be doing anything in the main script. I was very curious about the syntax of that line that you quoted and I thank you for your reply.

-Batch
  #4 (permalink)  
Old 12-07-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
try putting a set -x on the line before and a set +x on the line after so you can see exactly what happens on that line.
  #5 (permalink)  
Old 12-08-2006
Batch Batch is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 3
It was a permissions problem. Thanks for all your help.
Sponsored Links
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 04:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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