![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get next 2 lines after a "pattern line" | fongthai | UNIX for Dummies Questions & Answers | 2 | 05-09-2008 01:20 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| How to REMOVE USER that display error --> "Name is too long" | mgonzal | AIX | 1 | 06-27-2005 01:47 PM |
| Long time since I used "expect" | scriptosaurus | Shell Programming and Scripting | 2 | 04-14-2005 12:51 PM |
| "Arguments too long" | Peterh | UNIX for Dummies Questions & Answers | 2 | 08-12-2003 05:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Vi - "The replacement pattern is too long"
Hi,
I am trying to replace a value in a script with another value. I am performing a vi command from another script. Code:
vi - ${conf_path}/CANCEL_CD_PART2.txt<<!
:%s/RANGE/${btch_range}/g
:wq
!
Quote:
Quote:
Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
in vi editor you can replace max of 256 bytes..
so try using sed externally it allows upto 4000 chars |
|
#3
|
|||
|
|||
|
Used sed
Thanks! It worked. I used the sed command instead, as you suggested.
Code:
sed "s/RANGE/${btch_range}/g" ${conf_path}/CANCEL_CD_PART2.txt > ${conf_path}/CANCEL_CD.txt
|
|
#4
|
|||
|
|||
|
or you could set range to the variable not to the value contained in that variable :
Code:
:%s/RANGE/\${btch_range}/g
so before we have: Code:
PARM1=RANGE Code:
PARM1=${btch_range}
|
|||
| Google The UNIX and Linux Forums |