Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: s/pattern/pattern/g on the commandline ?



2012/2/25 Jérémie Roquet <arkanosis@xxxxxxxxx>:
> !!:gs/<searched>/<replacement>/

By the way, that's for the last command, but you can also use:

!-2:gs/<searched>/<replacement>

… for the command before;

!-3:gs/<searched>/<replacement>

… and so on, as well as:

!42:gs/<searched>/<replacement>

… for the 42nd command in your history (the command's number is
displayed in your prompt if you have %! in it but you can use the
“history” command as well).

Best regards,

-- 
Jérémie



Messages sorted by: Reverse Date, Date, Thread, Author