![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Query related to scp command | sureshg_sampat | Shell Programming and Scripting | 2 | 12-03-2007 02:59 AM |
| rsh and sql query | sars | Shell Programming and Scripting | 1 | 02-21-2007 04:50 AM |
| query on grep command | collins | UNIX for Dummies Questions & Answers | 4 | 06-21-2006 03:35 PM |
| query | varadakumar | UNIX for Advanced & Expert Users | 1 | 04-11-2002 09:09 AM |
| FTP query | csong2 | UNIX for Advanced & Expert Users | 1 | 11-29-2001 01:50 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have done a script using sed which replaces a string in file.
I face 2 problems, while using sed command. 1)last line of the file is missing. 2)if i am are using wild card character in the command, Its not taking the next matching pattern ie if I am giving the pattern abc*def to be replaced with abcXdef : and the input file contains:- abctttttttttttdefmmmmmmmmmabcttttttttttdef the o/p i am expecting is abcXdefmmmmmmmmmabcXdef but the o/p I am getting is abcXdef. the first problem is getting solved when i put an enter in the last line in the file. But i am having pratical difficulty that Its ahecking almost 600files. My script code is giving below script.sh ................................. #!/bin/sh find /opt/users/adm5tca1/simulator/OSDI/OSDISimulator/jakarta-tomcat-5.0.28/webapps/OSDI_SIM/WEB-INF/classes/workarea/ -name 'ResponseBody.txt' 2>/dev/null > pathy.txt FILE_NAME=pathy.txt while read a_line ; do echo $a_line /usr/bin/sed -e 's!<ns6\:originatingOrderLines><ns6\:item>.*<\/ns6\:item><\/ns6\:originatingOrderLines>!<ns6\:originatingOrderLines><ns6\:item>DEFAULT<\/ns6\:item><\/ns6\:originatingOrderLines>!g' $a_line > bb.txt mv bb.txt $a_line done < $FILE_NAME ................................................. Can anyone plz help me in solving out. Last edited by vino; 06-13-2008 at 12:40 AM. Reason: disabled smilies |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
This query is a duplicate of http://www.unix.com/shell-programmin...#post302204979
Last edited by spirtle; 06-13-2008 at 02:05 AM. Reason: duplicate |
|||
| Google The UNIX and Linux Forums |