![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 remove space in sed for / character | vasanth_vadalur | Shell Programming and Scripting | 3 | 06-17-2009 10:09 AM |
| to remove space in a txt file | manit | UNIX for Dummies Questions & Answers | 19 | 01-13-2009 11:14 AM |
| to remove space after numeric | ali560045 | Shell Programming and Scripting | 2 | 09-17-2008 06:23 AM |
| how to get a space between the result of (date +%d) command | ladtony | Shell Programming and Scripting | 12 | 09-09-2008 01:41 PM |
| remove space characters | melanie_pfefer | Shell Programming and Scripting | 1 | 03-11-2008 01:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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:- Code:
if [ $? -eq 0 ]; then $ECHO "The Path is:" $OFFERING_FILE_PATH/$z $ECHO $Z else $ECHO "" fi Output:- Code:
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"> |
|
||||
|
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.
|
|
||||
|
Sure,
There is no problem posting it here:- Code:
#!/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
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|