Script Bash and History Unix
- by user1107078
i just start to use Script bash on UNIX and i didnt find a solution to write the first command in the history which start , for example , with ls. If i write in the shell
history
!ls
it works but when i'm going to create a script it wont 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 echo "HISTFILE is $HISTFILE" print me only HISTFILE is ??
Thanks