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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to store the sql query's output in a variable venkatesh_sasi Shell Programming and Scripting 4 01-17-2008 09:03 PM
store awk results in a variable forever_49ers Shell Programming and Scripting 1 09-19-2006 07:51 PM
Store output and Echo meyerder Shell Programming and Scripting 2 05-14-2006 06:44 AM
store output to a file and read from it afadaghi Shell Programming and Scripting 2 10-04-2005 09:00 AM
How to store output in variable when put in background sanjay92 UNIX for Dummies Questions & Answers 1 02-22-2005 11:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2007
Registered User
 

Join Date: Jul 2007
Posts: 7
To store the output in a variable

Hi,

I am getting the following error while executing the script. Please can someone throw some light where is the problem. Many thanks.

./check[53]: temp: not found
The directory related to SEP instance 4 does not exist.

The script is as follows.

SEP_APP="/scp/sepx/app
/scp/sepx/current/app
/scp/sepx/data
/scp/sepx/output
/scp/sepx/shared
/scp/sepx/log
/scp/sepx/backup
/scp/sepx/install
/scp/sepx/dump
/scp/sepx/journal
/scp/sepx/versions
/scp/sepx/oss
/scp/sepx/sockets
/scp/sepx/support"

MAX_SEP_INSTANCE="1 2 3 4"

for number in `echo $MAX_SEP_INSTANCE`
do
echo
echo "check the directory structure for SEP instance $number..."; echo
for file in $SEP_APP
do
temp = `echo $file | sed -e "s/\/sepx/\/sep$number/"`
if [ ! -d "$temp" ]
then
echo "The directory $temp related to SEP instance $number does not exist."; echo
continue
fi
done

done
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-10-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,662
Quote:
Originally Posted by Sudhakar333 View Post
temp = `echo $file | sed -e "s/\/sepx/\/sep$number/"`
Drop the whitespace before and after =
Code:
temp=`echo $file | sed -e "s/\/sepx/\/sep$number/"`
Reply With Quote
  #3 (permalink)  
Old 07-10-2007
Registered User
 

Join Date: Jul 2007
Posts: 7
To store the output in a variable

Many thanks.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0