Chris's Wiki :: blog/unix/TimeBeforeReadline Commentshttps://utcc.utoronto.ca/~cks/space/blog/unix/TimeBeforeReadline?atomcommentsDWiki2020-08-17T13:43:47ZRecent comments in Chris's Wiki :: blog/unix/TimeBeforeReadline.By Geoff Richards on /blog/unix/TimeBeforeReadlinetag:CSpace:blog/unix/TimeBeforeReadline:348d648d87e5f84b5d30547f692b1162395504f9Geoff Richardshttps://geoffrichards.co.uk/<div class="wikitext"><p>About the only time I use the ! stuff is to repeat a command in $().</p>
<p>Usually it's when I've run 'find' or 'grep -l' to get a list of files,
and the next step is to go through them with an editor. I like to run
the find/grep on its own first to see if the filenames look right, but
then I can just do:</p>
<pre>
vim $(!!)
</pre>
</div>2020-08-17T13:43:47ZFrom 193.219.181.242 on /blog/unix/TimeBeforeReadlinetag:CSpace:blog/unix/TimeBeforeReadline:eca030c6e851b57512433d343093bdfd97bfc7ffFrom 193.219.181.242<div class="wikitext"><p>Huh, I didn't know the 't' in tcsh stands for "TENEX line editing". (For some reason I had thought it was csh that was advertised as the "line editing" shell...) I haven't ever had the chance to use TENEX but it seems to be rather influential in that regard – I remember seeing it mentioned in Kermit docs for the same reason.</p>
<p>History substitutions interact very poorly with bash's quoting/escaping mechanisms, to the point that I disable the function entirely so I could use <code>!</code> in commands without fear. Haven't really missed it much; most of my needs are indeed served by readline (e.g. the <code>Alt+.</code> shortcut instead of <code>!$</code>). Admittedly there are <em>some</em> situations where <code>^foo^bar</code> would be much faster than Ctrl-arrowing all the way back, but if the command gets so long then usually it's time to turn it into a shell script instead...</p>
</div>2020-08-17T04:58:10Z