Quoting "Chet Ramey" <chet.ra...@case.edu>:

On 12/15/15 11:37 AM, up201407...@alunos.dcc.fc.up.pt wrote:

You just need to enable history (set -o history).  History is independent
of whether or not the shell is interactive; it's just enabled by default
in interactive shells.

doing a "set -o history" didn't work for me, only when i added a "history
-a" eg:

$ cat x19
#!/bin/bash

rm -f /tmp/history      # make sure it's not there

set -o history
HISTFILE="/tmp/history"
HISTSIZE="1000"

printf 'something\n'
$ ../bash-4.3-patched/bash ./x19
something
$ ls -l /tmp/history
-rw-------  1 chet  wheel  61 Dec 15 11:48 /tmp/history
$ cat /tmp/history
HISTFILE="/tmp/history"
HISTSIZE="1000"
printf 'something\n'


Quoting "Chet Ramey" <chet.ra...@case.edu>:

On 12/15/15 11:37 AM, up201407...@alunos.dcc.fc.up.pt wrote:

You just need to enable history (set -o history).  History is independent
of whether or not the shell is interactive; it's just enabled by default
in interactive shells.

doing a "set -o history" didn't work for me, only when i added a "history
-a" eg:

$ cat x19
#!/bin/bash

rm -f /tmp/history      # make sure it's not there

set -o history
HISTFILE="/tmp/history"
HISTSIZE="1000"

printf 'something\n'
$ ../bash-4.3-patched/bash ./x19
something
$ ls -l /tmp/history
-rw-------  1 chet  wheel  61 Dec 15 11:48 /tmp/history
$ cat /tmp/history
HISTFILE="/tmp/history"
HISTSIZE="1000"
printf 'something\n'


$ cat x19
#!/bin/bash

rm -f /tmp/history        # make sure it's not there

set -o history
HISTFILE="/tmp/history"
HISTSIZE="1000"

printf 'something\n'
$ bash ./x19
something
$ ls -l /tmp/history
ls: cannot access /tmp/history: No such file or directory
$ bash --version
GNU bash, version 4.2.53(1)-release (x86_64-redhat-linux-gnu)

Or did you just patch it, since you used "../bash-4.3-patched/bash ./x19" ?

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


Reply via email to