Grep collection

From Natenoms discontinued Wiki
Jump to: navigation, search

A collection of useful grep commands ...

1 DokuWiki

Replace http://wiki.natenom.com/w/xyz/sub by [[nnew>xyz/sub]].

First, change directory to dokuwiki_install_dir/data/pages, then run:

for file in $(grep -i -r 'wiki\.natenom\.com' ./ | sed -r -n -e 's#\.\/([^:]*)\:.*#\1#p'); do sed -i -r -e 's#(http://)wiki\.natenom\.com/w/([^. ]*).*#\[\[nnew\>\2\]\]#g' "${file}"; done

2 See also

Icons oxygen 128x128 actions go-next.png See also: Code snippets