Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!usfvax2!tscs!root From: root@tscs.UUCP (Admin) Newsgroups: comp.sources.d Subject: Re: Bourne Again Shell? Message-ID: <278@tscs.UUCP> Date: 17 Feb 89 03:36:10 GMT References: <26563@teknowledge-vaxc.ARPA> <42400008@uicsrd.csrd.uiuc.edu> <3071@ficc.uu.net> <7700@chinet.chi.il.us> Reply-To: gerard@tscs.UUCP (0000-Admin) Organization: Total Support Computer Systems, Tampa, Florida Lines: 39 In article <7700@chinet.chi.il.us> les@chinet.chi.il.us (Leslie Mikesell) writes: >In article <3071@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: > >>Korn Shell with CSH history... >>Is that too much to ask? > >I really hate to ask this, but... What can you do with csh history that >you can't do with ksh's? I really like the ksh ability to use editor >syntax to search for a previous command and modify it before re-execution. >Does csh have something like that? I'll have to admit to not having much experience with the Korn shell (a couple of hours at 1200 baud), but I have not figured out how to emulate some of my favorite csh command editing features: (assume the following command sequence) (1): tar cvf /tmp/foobar ./{src,bin} ./local/bar (2): chmod 440 !:2 (expands to: chmod 440 /tmp/foobar) (3): chown root !$ (expands to: chown root /tmp/foobar) (4): ls -l !ta:3-$ (expands to: ls -l ./{src,bin} ./local/bar) (which works out to: ls -l ./src ./bin ./local/bar) These features of csh are handy, if the Korn shell can do this, I'd be interested in hearing about it. My only real gripe about csh is the inability to edit across multiple arguments such as: (5): find . -type f -print | xargs -t chmod 644 It would be nice to be able to change " f " to " d " and "644" to "755" a little bit easier than: (6): !!:0-2 d !!:4-$:s/644/755/ It's too bad you just can't use: !!:s/ f / d /:s/644/755/ Granted if you had an editor to edit your command line, this last example would not be a problem; however, being able to easily extract various arguments from any of your previous commands with only a few keystrokes is great!! I am not attempting to start a religious debate, I'm only curious if the Korn shell can do argument substitution as well as the C shell?