Gheek.net

September 24, 2008

Vi/Ex script line mode

Filed under: Ex, linux, Vi — Tags: , , — lancevermilion @ 5:09 pm

This would edit “/etc/ld.so.conf” which is owned by root and allow you to add “/usr/local/BerkeleyDB.4.6/lib” to the end of the file. “$” represents the last line of the file (this is determined by Vi/Ex). If you were to put the number “5” in place of “$” and there was only 2 lines in the file this would fail since that line does not exist.

sudo ex - /etc/ld.so.conf << BLAH
$ append
/usr/local/BerkeleyDB.4.6/lib
.
wq
BLAH

This will search “/etc/openldap/slapd.conf” for “var//” and replace that with “var/” AND “etc//” and replace that with “etc/”.

sudo ex - /etc/openldap/slapd.conf << BLAH
g/var\/\//s//var\//g
g/etc\/\//s//etc\//g
wq
BLAH

Reference Here for a command guide.
Reference Here for a tutorial.

Advertisement

Create a free website or blog at WordPress.com.