News for hackers. Stuff that matters.
Re:Unix tricks by sciurus on Thursday March 07, 2013 @01:02PM (#5339074)
A sometimes handy addition to the s modifier is g, which replaces all instances of the pattern instead of just the first.

    $ echo "foo foo"
    foo foo
    $ echo !!:s/foo/bar
    echo echo "bar foo"
    echo bar foo

    $ echo "foo foo"
    foo foo
    $ echo !!:gs/foo/bar
    echo echo "bar bar"
    echo bar bar

There are no comments on this comment yet.