4 ms·
Similar Perl/Awk syntax for Python one-liners with BEGIN/END: http://code.activestate.com/recipes/577075-pyliner-script-to-run-arbitrary-python-code-on-the/?in=
by dgulino 15y ago
Similar Perl/Awk syntax for Python one-liners with BEGIN/END:
http://code.activestate.com/recipes/577075-pyliner-script-to-run-arbitrary-python-code-on-the/?in=user-4119417 http://code.activestate.com/recipes/577075-pyliner-script-to...
- phaylon 15y agoThe -e is what tells perl that "this is code, not a filename." One I regularly use (with perl) that doesn't seem to be mentioned yet is -p -i -e to inline modify files line-by-line. This is very nice for global search/replace actions on files found via find, grep or ack.
- telemachos 15y agoYup, -i is very very useful, though I prefer to always call it as -i.bak (=> do the edit in place and make a backup of the original file as "filename.original.bak"), in case I do something hideously wrong. For what it's worth (you may know this but maybe not everyone does), Ruby also provides the -i flag.