Wednesday, December 6, 2006

Perl Search and Replace

by damonp on December 6, 2006

in Snippets

perl -pi -e "s/SEARCH/REPLACE/" FILES

Example (from Awstats configuration):

perl -pi -e "s/AllowToUpdateStatsFromBrowser=0/AllowToUpdateStatsFromBrowser=1/" *.conf

If SEARCH is a file path, make sure and not beat your head for an hour. Escape the path breaks (‘/’) or change the regep delimiters (ex. ‘|’):

perl -pi -e "s|SEARCH|REPLACE|" FILES

Popularity: 1%

{ 0 comments }

Somnambulist

by damonp on December 6, 2006

in Dictionary

  • a person who engages in somnambulism (sleepwalking)
  • a term used in hypnosis to indicate someone of high enough suggestibility to follow suggestions without the need for a formal trance

Popularity: 1%

{ 0 comments }