On 6/11/19 9:38 AM, _...@crans.org wrote: > Chet Ramey wrote (2019-06-10 15:22): >> On 6/8/19 3:41 PM, _...@crans.org wrote: >>> >>> What makes me think it is an actual bug is that when the >>> "history" option was already enabled, "set -o history" should >>> have no effect; yet lines before are not recorded, and lines >>> after are recorded. >> >> Bash temporarily stops recording commands in the history when you use >> `eval', but if you turn history back on explicitly using `set -o history', >> it will honor that. > > In that case, shouldn’t `eval "set -o"' report that the "history" option > is off while `eval' is running? Currently, it says me that it is on.
Maybe. But the user-visible option that says whether or not to save commands in the history is decoupled from the internal set of flags that control it. The option should remain visibly on unless the user turns it off, even if saving commands in the history is temporarily suppressed. The thing is that enabling history with `set -o history' turns all of these things on. > While we are at it, are there other special behaviors of `eval` that one > should be aware of, particularly regarding doing `eval $(set +o)' ? The > manual does not say much about the `eval' builtin. It's not clear, since eval just reads and executes commands. The answer really depends on the commands you give it. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
signature.asc
Description: OpenPGP digital signature