Are compound command's second and subsequent lines not effected by HISTCONTROL in bash?
- by UniMouS
When consulting bash's man page, it read this sentence about bash history:
The second and subsequent lines of a multi-line compound command are
not tested, and are added to the history regardless of the value of
HISTCONTROL.
But I have tried this:
$ HISTCONTROL=ignorespace
$ if [ -f /var/log/messages ]
> then
> echo "/var/log/message exists."
> fi
$ history | tail -2
18 HISTCONTROL=ignorespace
19 history | tail -2
Note that the if is leaded by a space. Why the second line of this if compound command still not appear in the history?