Thursday, October 4, 2007

using sed to edit a string in a file

action:
use sed to change a windows path 'g:\\' to a unix path '/share/data' in a file

command:
sed -e 's/g:/\/share\/data/g' -e 's/\\\\/\//g' file.2

comment:
sed == is a stream editor that can be used from the command line
format is - sed [command] <[inputfile]>[outputfile]
-e == is followed by a command, in this case a regex
< == is the input file
> == is the output file

vi keybindings for xpdf

Here is how to enable vi keybindings for xpdf navigation (j for up, k for down, h for left, l for right).

Add the following line to your ~/.Xresouces file.

xpdf.viKeys: true
Then run xrdb to load the changes:
xrdb ~/.Xresouces


source: http://linuxwisdom.blogspot.com/search?q=xpdf