Script Bash and History Unix

Posted by user1107078 on Stack Overflow See other posts from Stack Overflow or by user1107078
Published on 2012-04-13T17:16:11Z Indexed on 2012/04/13 17:30 UTC
Read the original article Hit count: 162

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about bash

Related posts about unix