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
How to store the sql query's output in a variable venkatesh_sasi Shell Programming and Scripting 4 01-18-2008 01:03 AM
store awk results in a variable forever_49ers Shell Programming and Scripting 1 09-19-2006 10:51 PM
Store output and Echo meyerder Shell Programming and Scripting 2 05-14-2006 09:44 AM
store output to a file and read from it afadaghi Shell Programming and Scripting 2 10-04-2005 12:00 PM
How to store output in variable when put in background sanjay92 UNIX for Dummies Questions & Answers 1 02-22-2005 03:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-10-2007
Sudhakar333 Sudhakar333 is offline
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
  #2 (permalink)  
Old 07-10-2007
vino's Avatar
vino vino is online now Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
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/"`
  #3 (permalink)  
Old 07-10-2007
Sudhakar333 Sudhakar333 is offline
Registered User
  
 

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

Many thanks.
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 12:42 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