How to remove space in between the result

Hi All,

How do i remove the spaces in between, the outputted result: my output is like below and i dont want spaces between them, how do i do that. I am enclosing the peice of code that does that:-

 if [ $? -eq 0 ]; then
 $ECHO "The Path is:" $OFFERING_FILE_PATH/$z
 $ECHO $Z
 else
 $ECHO ""
 fi

##############################################
Output:-

Words to be searched: CCRCWebServerINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="CCRCWebServerINSTALLDIR">














Words to be searched: ClearCaseAdministrationTools-CINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="ClearCaseAdministrationTools-CINSTALLDIR">














Words to be searched: ClearCaseAdministrationTools-ent-CINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="ClearCaseAdministrationTools-ent-CINSTALLDIR">

It looks like that is from the contents of $Z. How does $Z get defined?

Hi Peterro,

The Z variable is defined as:-
Z=`find $OFFERING_FILE_PATH/$z | xargs grep $i`

Thanks for coming to help again

-Adi

Ok, what is $i? Is this script really large, or would it be appropriate to post all of it here? What I'm trying to get at is that if you can just gather the data you want, the output won't look so bad. From what I see so far, it looks like your getting too much of something (blank lines) when defining variables.

why do u need the below code from ur code???

 else
 $ECHO ""

Sure,
There is no problem posting it here:-

#!/bin/sh

ECHO=/bin/echo
CAT=/bin/cat
LS=/bin/ls
AWK=/bin/awk
GREP=/bin/grep

FIX_XML_PATH=/home/administrator/testfix/fix
FIX_FILE=`$LS $FIX_XML_PATH | $GREP xml`
OFFERING_FILE_PATH=/home/administrator/testfix/install/*.offering
OFFERING_FILE=`$LS $OFFERING_FILE_PATH | $GREP assembly`

Y=`$CAT $FIX_XML_PATH/$FIX_FILE | $GREP id | $AWK '{if($2 ~ /id=/) pri
nt $2}' | $AWK -F"'" '$1 == "id=" {print $2}'`

for i in $Y
do
 $ECHO "Words to be searched:" $i
 for z in $OFFERING_FILE
  do
   #$ECHO "The Path is:" $OFFERING_FILE_PATH/$z
   #Z=`find $OFFERING_FILE_PATH/$z -exec grep  $i {} \;`
   Z=`find $OFFERING_FILE_PATH/$z | xargs grep $i`

   if [ $? -eq 0 ]; then
   $ECHO "The Path is:" $OFFERING_FILE_PATH/$z
   $ECHO $Z
   else
   $ECHO ""
   fi

  done

Yup, I think malcomex999 has the answer. Change the

echo ""

to

echo "this line intentionally left blank"

and see what you get.

What kind of path is this?

OFFERING_FILE_PATH=/home/administrator/testfix/install/*.offering

Hi Pettero,

I i add the string you told me the output is like below, what do i do?

$ ./xmlParse123.sh
Words to be searched: CCRCWebServerINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="CCRCWebServerINSTALLDIR">
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
Words to be searched: ClearCaseAdministrationTools-CINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="ClearCaseAdministrationTools-CINSTALLDIR">
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
this line is intentionally left blank
Words to be searched: ClearCaseAdministrationTools-ent-CINSTALLDIR
The Path is: /home/administrator/testfix/install/cc.offering/com.ibm.rational.cl
earcase.assembly.assembly
<includedShareableEntity id="ClearCaseAdministrationTools-ent-CINSTALLDIR">
this line is intentionally left blank

---------- Post updated at 10:08 AM ---------- Previous update was at 10:06 AM ----------

Hi Franklin,

The path
/home/administrator/testfix/install/*.offering has all the file with the extension offering like abc.offering, etc

i guess if u remove the else part from ur first post(code) on this thread, it will be ok.

HI Malcom

Thanks a lot that worked!!!

Thanks
Adi