![]() |
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 |
| Sed-Special character replacement | usshell | Shell Programming and Scripting | 3 | 05-22-2008 11:06 AM |
| special character on Filename.. help!!!urgent | genzbeat | HP-UX | 1 | 01-18-2008 03:55 PM |
| convert special character like £ | cynnie | Shell Programming and Scripting | 1 | 08-08-2007 07:37 AM |
| Special character in my file | Ryan2786 | UNIX for Dummies Questions & Answers | 3 | 07-06-2007 12:35 AM |
| special character ? | mile1982 | High Level Programming | 1 | 10-19-2004 09:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed treats & as the pattern space - in other words what sed found as a match for your regular expression. & as an operator means "print the pattern space".
One workaround without doing a lot of sed hacking is to change the & character to something else, then change it back using tr: Code:
tr '&' '+' < a.txt > tmpfile y=`echo $a$b$i` z=`echo $a$b$i$b$x` sed s/"$y "/"$z "/g tmpfile | tr '+' '&' > CusT_TmP cat CusT_TmP a.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|