[NCLUG] Shells and stuff...

jbass at dmsd.com jbass at dmsd.com
Wed Jun 25 02:59:10 MDT 2003


Michael Milligan <milli at acmeps.com> writes:
> PS: Doesn't everyone know bash and vi rule on GNU/Linux?  ;-)

Yeah, but how many people use VI as a shell frontend with powerful editing
and script formation tools? For example consider the sequences as root:

	# vi
	!!chkconfig --list
	:g/:on/d
	:/xinetd based services/d
	:1,$s/[ :].*//
[delete lines for any service you don't want turned on]
	:1,$s/.*/chkconfig & on/
	:1
	!Gsh
	:q!

or the inverse

	# vi
	!!chkconfig --list
	:v/:on/d
	:1,$s/[ :].*//
[delete lines for any service you don't want turned off]
	:1,$s/.*/chkconfig & off/
	:1
	!Gsh
	:q!

Other common variations are using !!find or !!ls for a list of files, editing
the list, then !G the list to xargs cmd, or build up the command in VI then
send to shell directly.

John



More information about the NCLUG mailing list