Live data from Hacker News

“I have [bash] history back to ~2003”

twitter.com

11–20 of 148 posts

Re: “I have [bash] history back to ~2003”

#12
post #6

yeah i wonder how many passwords are stored in there in free text format

   echo "Password: "; read -s pass; stuff --pass "$pass"
Where stuff takes password as an argument. Alternatively you can start your line with a space character and it isn't stored in your history.

Re: “I have [bash] history back to ~2003”

#13
post #9
post #8

I recently set up my bash history to collect into an sqlite database. Besides the exact command it records the working directory, return value, starting time, ending time, a shell and a login session id. It doesn't handle background jobs well right now though.

Okay I'm curious as to why? I mean it's nice to have, but what are you going to do with the additional data later on?

It was mainly for an exercise to get familiar with sqlite. Maybe later very rarely I can use the session data (hunting down sessions where you only remember some irrelevant command). Getting the duration of some commands is useful like long running simulations, compilations. It's especially handy where you don't expect it to be too long and forget to time it beforehand.

Having said that I didn't use it too much yet, I have my regular history in place too.

Re: “I have [bash] history back to ~2003”

#14
post #8

I recently set up my bash history to collect into an sqlite database. Besides the exact command it records the working directory, return value, starting time, ending time, a shell and a login session id. It doesn't handle background jobs well right now though.

I would love to use this! Had to grep through ancient backup diffs way too many times to resurrect that perfect command line.

Re: “I have [bash] history back to ~2003”

#16
post #12
post #6

yeah i wonder how many passwords are stored in there in free text format

echo "Password: "; read -s pass; stuff --pass "$pass" Where stuff takes password as an argument. Alternatively you can start your line with a space character and it isn't stored in your history.

Cool, did not know that about the leading space.

Re: “I have [bash] history back to ~2003”

#18
post #12
post #6

yeah i wonder how many passwords are stored in there in free text format

echo "Password: "; read -s pass; stuff --pass "$pass" Where stuff takes password as an argument. Alternatively you can start your line with a space character and it isn't stored in your history.

The leading space behaviour is true only if HISTCONTROL="ignorespace" is set.

Re: “I have [bash] history back to ~2003”

#19
bash history had never seemed to work for me between tmux windows. Commands are 'trapped' in their respective window and the last one to close 'wins' and writes its history over the others.

So I end-up with never-closing task-based window sessions and occasionally copy-paste commands to a safe file for future reference.

I really should investigate the root cause some day...

Post reply on HN