It's actually a misunderstanding. The `global' substitution enabled
with the `g' modifier means to change the first occurrence of (in
your example) `s' into `z' in all words in the previous command
instead of the first. There's no way to do what you want with the
csh-style history substitution.
Chet
--
"You can watch an actor absolutely sabotage a good script and then read
reviews like 'Unfortunately, even the impressive talents of Cheech Marin
could not salvage Anton Chekhov's trite and meandering script.'"
Chet Ramey, Case Western Reserve University Internet: ch...@po.CWRU.Edu
I'm not sure whether I'm using bash correctly, but I think my version has a
bug in global substitution.
GNU bash, version 1.13.4-CWRU
Sun SparcStation IPX, SunOS 4.1.1
Compiled using Sun's cc
Take a simple example like 'ls /etc/passwd'
Let's say that I then decide (for no readily apparent reason) that I want to
change all the `s' characters to `z'. I imagined I would type something like
!!:gs/s/z/
but this yields
lz /etc/pazswd
When I tried
ls /etc/passwd /etc/fstab
!!:gs/s/z/
I got
lz /etc/pazswd /etc/fztab
and when I tried
ls /etc/passwd /etc/passwd
!!:gs/s/z/
I got
lz /etc/pazswd /etc/pazswd
Should it change every occurrence of `s' to `z', or only the first occurrence in
every word? Am I just using it incorrectly?
Thanks for your help in understanding this one...
-Chrisl
___________________________________________________________________________
chr...@jfbi.cv.com Chris Parkin Lilley, Un petit d'un petit
Phone: (+44) 203 874368 ProFET Development Team S'etonne aux Halles
Fax: (+44) 203 874761 Rover Group, UK Un petit d'un petit
A degres te falles
___________________________________________________________________________