Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!cwns1!chet From: chet@cwns1.CWRU.EDU (Chet Ramey) Newsgroups: gnu.bash.bug Subject: Re: readline enhancement request Keywords: bash 1.04 readline enhancement Message-ID: <1990Jan10.190120.6076@usenet.ins.cwru.edu> Date: 10 Jan 90 19:01:20 GMT References: <130059@sun.Eng.Sun.COM> Distribution: usa Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 48 In article <130059@sun.Eng.Sun.COM> anantha%ravi@Sun.COM (Anantha Srirama) writes: - When KSH is in EMACS editing mode one can yank the last argument of the previous command, a la !$ in BASH or CSH, and insert it in the present command line. This is done physically, meaning the last argument of the previous command line appears when you type _ This is a nice feature which is notably absent in bash-1.04. Bash naively assumes that the only things one wants to do with the last argument of the previous command is to reuse it, which is not the case many times. Many a times I yank this argument and tweek it. I have implemented this; it's an easy hack in bashline.c. I have sent it to Anantha in a separate message. - KSH provides a wide array of utilities to manipulate the value of variables as follows: ${param#pattern} -> remove small left pattern from 'param' ${param##pattern} -> remove large left pattern from 'param' ${param%pattern} -> remove small right pattern from 'param' ${param%%pattern} -> remove large right pattern from 'param' I have done this as well. I *just* sent the code to Brian for testing (like this morning), and it should appear in the next release. These are very useful utilities that I use a lot in shell scripts which rename, unshar... a group of files ksh$ for i in part?.Z ksh> do ksh> uncompress $i > ${i%.Z} ksh> done The above script in KSH puts all the uncompressed files in 'part?' I don't know how one would do it in bash-1.04?? for i in part?.Z do stem=$(basename $i .Z) uncompress $i > $stem done Chet Ramey -- Chet Ramey Network Services Group "Help! Help! I'm being Case Western Reserve University repressed!" chet@ins.CWRU.Edu