0
1
Not really a question but an observation. When I do sys ad on Linux, I like to precede commands with a hash '#' to proof-read what I am about execute, and also to leave a breadcrumb so that I can come back to it later on.
I've found out recently on macOS Catalina (this being my main workhorse now), that bash
does not print lines in the history file with a preceding hash, that doe snot appear to be the case in othe flavours of Linux, i.e. RHEL, Ubuntu
$ echo $SHELL
/bin/bash
$ echo foo
foo
$ #echo bar
$ !:p
echo foo
$ echo $SHELL
/bin/sh
$ echo foo
foo
$ #echo bar
$ !:p
#echo bar
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A602
Outputs of $HISTIGNORE
$HISTCONTROL
Sure
$ echo 0e"$SHELL\n$HISTIGNORE\n$HISTCONTROL"
/bin/sh
$ echo -e "$SHELL\n$HISTIGNORE\n$HISTCONTROL"
/bin/bash
Can you show the output of
echo $HISTCONTROL
andecho $HISTIGNORE
? – Spiff – 2019-10-23T01:22:20.553Hi @Spiff sure, I've editted my post with the output – meappy – 2019-10-23T03:32:21.127
macOS ships a really old version of bash. – egmont – 2019-10-24T09:10:55.047