On Sun, 8 Jul 2018 21:56:50 -0400 "Theodore Y. Ts'o" <tytso(a)mit.edu>
wrote:
These days, I'll just use emacs's
query-replace, which will allow
me to approve each change in context, either for each change, or
once I'm confident that I got the simple-search-and-replace, or
regexp-search-and-replace right, have it do the rest of the changes
w/o approval.
I often use a utility called "qsubst" that allows emacs-like query
replace at the command line. I got it off the net around 1990 and
haven't seen it widely distributed, but it's Damn Useful.
On the more general topic: I, too, never used Unix on a printing
terminal (by the time I got to it in the early 1980s everything was
CRTs) and I've used shell scripts pretty consistently over the few
decades. I tend not to write really long ones any more -- the advent
of Perl and then languages like Ruby and Python sort of ended that --
but I write short ones a lot, and I write five-line ones at the bash
prompt several times a day. (One reason why emacs/vi like command
line editing is so useful to me is it lets me quickly hack up a
script at the terminal prompt.)
And yes, if it's got a couple of nested loops and a long pipeline or
two, I think it's still a script even if I type it ad hoc.
It's not what you *can't* do with a
glass-tty. It's just that with
a glass-tty, I'm much more likely to rely on incremental searches
of my bash command-line history to execute previous commands,
possibly with some changes, because it's more convenient than
firing up an editor and creating a shell script.
Indeed. That's my work style as well.
Perry
--
Perry E. Metzger perry(a)piermont.com