Thread View: gnu.bash.bug
3 messages
3 total messages
Started by Gregory Bond
Fri, 01 Sep 1989 06:22
Some minor bash nits/wouldlikes
Author: Gregory Bond
Date: Fri, 01 Sep 1989 06:22
Date: Fri, 01 Sep 1989 06:22
54 lines
2402 bytes
2402 bytes
Coming from a (SunOS 3.5) csh environment, there are a few things I'd really like to see in bash: For history, a few inconsistancies: There is no :gs operator for replacing on the whole line. e.g. % echo hello hello hello hello % !!:gs/ll/xdr/ echo hexdro hexdro hexdro hexdro And the existing :s operator doesn't do delimiter-escaping or &-expanding. e.g. % echo qweryuiop qweryuiop % !!:s/qwer/&t echo qwertyuiop qwertyuiop % echo hello/world hello/world % !!:s/llo\/wo/ll0\/wo/ echo hell0/world hell0/world Fixing this would require some rewrite of the :s processing in history.c. I am intending to look at this at some point soon. Is there some philosophical reason why this is a bad idea (e.g. a decision that the csh history mechanism is in some sense flawed)? 2) When starting window tools in the background, they inherit the tty state from bash and use that for the command window. (The tool I notice this from is Sun's dbxtool). This leaves the dbxtool command window in cbreak/noecho mode. Most annoying. And you can't start it in foreground and then ^Z it as dbxtool ignores ^z. Dammit. I guess this is in general impossible to ensure, because you can never tell when the background task has read the tty state and thus it is safe to reset it. Just put it down to broken dbxtool. Should be documented pretty clearly in the eventual manual. 3) Sun csh does completion on ~u<ESC> for usernames. A useful feature I may add one day. 4) Sun csh, when given a "cd dir1" will try current dir, then cdpath, then a shell/environment variable called "dir1". I've found this really usefull for working on multiple versions of the one source: a command can set shell variables for make, etc, and vars for src, run, lib etc. Then "cd run" changes to the correct run directory. Again, should be easy to add. The sun version didn't know about paths, so perhaps you could make "cd dir1/dir2" equivalent to "cd $dir1/dir2". Greg.
Some minor bash nits/wouldlikes
Author: Brian Fox
Date: Fri, 01 Sep 1989 15:33
Date: Fri, 01 Sep 1989 15:33
76 lines
2994 bytes
2994 bytes
I will be placing 1.03 on prep.ai.mit.edu today. Date: Fri, 01 Sep 89 16:22:08 +1000 From: Gregory Bond <munnari!melba.bby.oz.au!gnb@uunet.uu.net> Coming from a (SunOS 3.5) csh environment, there are a few things I'd really like to see in bash: For history, a few inconsistancies: There is no :gs operator for replacing on the whole line. e.g. % echo hello hello hello hello % !!:gs/ll/xdr/ echo hexdro hexdro hexdro hexdro That is right, I didn't write a `g'lobal operator. I may add one in the future. And the existing :s operator doesn't do delimiter-escaping or &-expanding. e.g. % echo qweryuiop qweryuiop % !!:s/qwer/&t echo qwertyuiop qwertyuiop THe ampersand is replaced by the matched text? What if you are just adding an ampersand, which seems to me to be a common case: bash$ hairy-function argument bash$ !!:s/argument/another-argument & <- user wants to background this job. % echo hello/world hello/world % !!:s/llo\/wo/ll0\/wo/ echo hell0/world hell0/world I didn't do delimiter escaping. However, the first character following the `:s' is the delimiter, so you can choose it when typing in the substitution request. For example: !!:s@llo/wo@ll0/wo would do what you wanted. 2) When starting window tools in the background, they inherit the tty state from bash and use that for the command window. (The tool I notice this from is Sun's dbxtool). This leaves the dbxtool command window in cbreak/noecho mode. Most annoying. And you can't start it in foreground and then ^Z it as dbxtool ignores ^z. Dammit. I have fixed this (to the best of my knowledge) in 1.03. 3) Sun csh does completion on ~u<ESC> for usernames. A useful feature I may add one day. It is in 1.03. 4) Sun csh, when given a "cd dir1" will try current dir, then cdpath, then a shell/environment variable called "dir1". I've found this really usefull for working on multiple versions of the one source: a command can set shell variables for make, etc, and vars for src, run, lib etc. Then "cd run" changes to the correct run directory. Again, should be easy to add. The sun version didn't know about paths, so perhaps you could make "cd dir1/dir2" equivalent to "cd $dir1/dir2". New variable in 1.03. "cdable_dirs", if it exists, says to do exactly that with arguments to pushd and cd. Brian
Re: Some minor bash nits/wouldlikes
Author: Rob McMahon
Date: Sat, 02 Sep 1989 12:45
Date: Sat, 02 Sep 1989 12:45
21 lines
1292 bytes
1292 bytes
In article <8909011533.AA11301@aurel.caltech.edu> bfox@aurel.caltech.edu writes: >THe ampersand is replaced by the matched text? What if you are just adding >an ampersand, which seems to me to be a common case: > > bash$ hairy-function argument > bash$ !!:s/argument/another-argument & <- user wants to background this job. bash$ !!:s/argument/another-argument/ & or bash$ !!:s/argument/another-argument \& or even bash$ !!:s/argument/another-&/ & :-) This is very useful sometimes for small additions to long replacements. Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads