I just start to use Script bash on UNIX and I didn't find a solution to write the first command in the history which starts, for example, with ls. If I write in the shell
history
!ls
it works but when I'm going to create a script it won't work.
This is my example code
#!/bin/bash
set -o | grep history
set -o history
#echo "HISTFILE is $HISTFILE"
#history "!ls";
#history
#!ls
history #it works
Another Question: Why does echo "HISTFILE is $HISTFILE" only print HISTFILE?
Thanks