Help needed to stick on variable data to an output

Hi all,

I need help now to stick the value inside $RHAT_PRODUCT and display that in every line in the output. What changes in the code can i do.

Please suggest

Thanks
Adsi

#!/bin/sh

ECHO=/bin/echo
FIND=/bin/find
AWK=/bin/awk
LS=/bin/ls
GREP=/bin/grep

ROOT_PATH=/net/icebox/vol/local_images/spins
STREAM_PATH=$ROOT_PATH/7.1
RHAT_PLATFORM=`$FIND $STREAM_PATH . -depth -name ShareableEntities | $AWK -F"/" '{if($10 ~ /rhat_x86/) print $0}'`
RHAT_PRODUCT=`$FIND $STREAM_PATH . -depth -name ShareableEntities | $AWK -F"/" '{if($10 ~ /rhat_x86/) print $8}'`

$ECHO "The Products are: " $RHAT_PRODUCT

usage() {
 $ECHO "Usage:  rhat"
}

check_rhat(){
for i in $RHAT_PLATFORM
do
$ECHO "The path is:" $i
$LS $i | $GREP .su | $AWK -F"_" '{print $1}'
done 
}

if [ $# -eq 0 ]; then
  usage
  exit 0
fi

PLATFORM_LIST="$*"
if [ "$1" = "sun" ]; then
  check_rhat
fi
exit 0

Original Output:-

The Products are: MS DS
 The Path is: /net/icebox/vol/local_images/spins/7.1/MS/7.1.D081110/rhat_x86/ShareableEntities
atria.basement.linux
atria.msgcat.JPN.linux
atria.perl.linux
CMServer.CQ.linux
com.ccl.feedreader.feature
The Path is: /net/icebox/vol/local_images/spins/7.1/DS/7.1.D081110/rhat_x86/ShareableEntities
MS.shipping.server.linux
org.eclipse.gef.feature
org.eclipse.jdt.feature
org.eclipse.platform.feature
org.eclipse.rcp.feature
ratl.WAS.linux

Output Desired:-

The Products are: MS DS
 The Path is: /net/icebox/vol/local_images/spins/7.1/MS/7.1.D081110/rhat_x86/ShareableEntities
MS DS atria.basement.linux
MS DS atria.msgcat.JPN.linux
MS DS atria.perl.linux
MS DS CMServer.CQ.linux
MS DS com.ccl.feedreader.feature
MS DS com.ccl.welcome.bits.feature
The Path is: /net/icebox/vol/local_images/spins/7.1/DS/7.1.D081110/rhat_x86/ShareableEntities
MS DS MS.shipping.server.linux
MS DS org.eclipse.gef.feature
MS DS org.eclipse.jdt.feature
MS DS org.eclipse.platform.feature
MS DS org.eclipse.rcp.feature
MS DS org.eclipse.test.feature
MS DS ratl.WAS.linux

Not sure, but try this:

$LS $i | $GREP .su | sed "s/^/$RHAT_PRODUCT\_/" | $AWK -F"_" '{print $1,$2}'

Disclaimer: Untested code.

tyler_durden