Hey Everyone,
I was editing an old script and need to do some repetative changes with numbers. I wanted to reduce a group of numbers (40-50) for simpilicities sake let say ten an many lines thoughout the script. I ended up doing:
:%s/40/30g
This worked fine on number at a time. However I am could never figure out why this wouldn't work:
:1,$!sed "s/[4-5][0-9]/`echo \& -10|bc`/g
The echo worked fine, but when I added the "bc" it killed it. Any other suggestions for the future???
I know I could have did it in perl, or an shell script...but I really just wanted to do it in Vi and it seems to me there must be a way
Maybe sed was the wrong choice???
BTW, I don't think it makes to much of a diff this particular one I was doing on HP-UX 11.
Thanks,
Mark