1

How to have bash' history as the same as the preceding Bash'?

Few last history of bash is demanded to be so in the following but fail

$ bash -lc 'find . -iname \*.c;  bash -l'
#or

$ bash -lc 'history -s find . -iname \*.c; history -w; bash -l'

won't have history of

find . -iname \*.c

How to solve such this?

1 Answers1

0

You are invoking a non-interactive shell to run your find-command.

Non-interactive shells do not have history by default.

See History command inside bash script for possible solutions.

markgraf
  • 2,860