The UNIX and Linux Forums  


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
Shell script..invoking command and exiting at fixed intervals rajuak12 Shell Programming and Scripting 1 07-19-2008 10:34 AM
Invoking shell script with perl command. nua7 UNIX for Advanced & Expert Users 1 07-10-2008 07:43 AM
exit status of Invoking two or more scripts in background Omkumar Shell Programming and Scripting 4 03-31-2005 08:25 AM
BUILT-IN command scripts JSP Shell Programming and Scripting 2 03-11-2002 09:52 AM
sqlplus and sh scripts (to_char command)) josecollantes UNIX for Advanced & Expert Users 4 09-06-2001 10:59 AM

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 03-19-2009
bce_groups bce_groups is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 7
Invoking 2 scripts in 1 command

HI,
I have 2 scripts main.sh and sub.sh, I want to invoke both these scripts in 1 unix command..
Something like... csh -f main.sh(sub.sh TIBCO)
sub.sh returns a value as .., by taking this value main.sh prints a text.
Can anyone help me to build this command
Below are the scripts
////sub.sh
#! /usr/bin/csh
set VAR_NAME=$1
eval echo \$$VAR_NAME

////main.sh
#! /usr/bin/csh
set VAR_NAME=$1
echo printing the value $VAR_NAME

Thanks in advance
  #2 (permalink)  
Old 03-19-2009
amitranjansahu's Avatar
amitranjansahu amitranjansahu is offline
Registered User
  
 

Join Date: Jan 2009
Location: Gurgaon,INDIA
Posts: 239
$main.sh ; sub.sh
  #3 (permalink)  
Old 03-19-2009
bce_groups bce_groups is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 7
HI ,

I tried calling the script as below and getting error

csh -f $main.sh ; sub.sh TIBCO_HOME
main: Undefined variable.

Thanks
  #4 (permalink)  
Old 03-20-2009
amitranjansahu's Avatar
amitranjansahu amitranjansahu is offline
Registered User
  
 

Join Date: Jan 2009
Location: Gurgaon,INDIA
Posts: 239
you can store the output of subscript in a variable user the main sript

////main.sh
#! /usr/bin/csh
VAR_NAME=`sub.sh`
echo printing the value $VAR_NAME
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:36 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