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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-09-2008
juedsivi juedsivi is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 2
Quote:
Originally Posted by joeyg View Post
Code:
> cat file3
<voms.db.type 
value="changeme"/>
<voms.db.host
value="changeme"/> 
<voms.admin.smtp.host 
value="changeme"/>
<voms.mysql.admin.password 
value="changeme"/>
<glite.installer.verbose 
value="true"/>
> sed "s/>/>~/g" file3 | tr -d "[ ][\n]" | tr "~" "\n"
<voms.db.typevalue="changeme"/>
<voms.db.hostvalue="changeme"/>
<voms.admin.smtp.hostvalue="changeme"/>
<voms.mysql.admin.passwordvalue="changeme"/>
<glite.installer.verbosevalue="true"/>
>
Explained...
substitute > with >~ so can easily find end-of-lines
delete space and new-line characters
(note, the sample I copied/pasted had extra spaces after data in some lines)
then substitute new-lines for the ~ I used as marker in first step

Expect someone to offer an easier solution, but this is one approach
Thank you for your help joeyg
the spaces are necesary, because after, I need capturing lines for show with Dialog, and the delimiter is value="changeme"... I change should be replaced by the user...

<voms.db.type value="changeme"/>
<voms.db.host value="changeme"/>

Thank You for your help