in reply to reg perl substitution
I assume you want to match the first occurence of 'newyork' (there's two in the line), so I anchored the pattern. Modify to suit your needs. The '-i' will save the original file with a .bak extension and modify the file in place for you.$ perl -i.bak -ape '/^newyork/ and s/153600/7878787878/' test.cfg
---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.
|
|---|