[NCLUG] Shells and stuff...
Jim Wildman
jim at rossberry.com
Wed Jun 25 07:23:10 MDT 2003
That's an interesting sequence.
Don't forget about the 'fc' command too.
Essentially, bash has done a Borg job on almost every good command line
feature of the other shells and can behave like one of them with a
little persuasion. I routinely use csh history commands (!!, !?, !-4,
!:s/pat/newpat/) in bash. Can always tell when someone has come over
from the windows world...they think the up arrow is the key to all shell
history.
------------------------------------------------------------------------
Jim Wildman, CISSP, RHCE jim at rossberry.com
http://www.rossberry.com
On Wed, 25 Jun 2003 jbass at dmsd.com wrote:
> 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
> _______________________________________________
> NCLUG mailing list NCLUG at nclug.org
>
> To unsubscribe, subscribe, or modify your settings, go to:
> http://www.nclug.org/mailman/listinfo/nclug
>
More information about the NCLUG
mailing list