TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You Should Be Logging Shell History

16 pointsby basenameabout 8 years ago

1 comment

antfarmabout 8 years ago
Instead of overriding PROMPT_COMMAND, you can also use <i>trap</i> to intercept signals, e.g.<p><pre><code> trap &#x27;[[ &quot;$BASH_COMMAND&quot; != &quot;$PROMPT_COMMAND&quot; ]] &amp;&amp; pwd&#x27; DEBUG </code></pre> <a href="http:&#x2F;&#x2F;tldp.org&#x2F;LDP&#x2F;Bash-Beginners-Guide&#x2F;html&#x2F;sect_12_02.html" rel="nofollow">http:&#x2F;&#x2F;tldp.org&#x2F;LDP&#x2F;Bash-Beginners-Guide&#x2F;html&#x2F;sect_12_02.htm...</a>