bash history
by aikempshall from LinuxQuestions.org on (#5RJ5F)
When I enter a multi-line command at the command line in bash like
Code:echo "alex" | while read LINE
do
EDIT_STRING=$(echo alex | grep "${LINE}" )
if [[ ! -z "$EDIT_STRING" ]];then
echo $EDIT_STRING
mktemp aik.XXXXXX
fi
doneit ends up in the history file as
Quote:
It is retrieved from history as
Quote:
Is there a way in bash to replicate the ksh behavior whereby the command would be stored in history exactly as entered i.e. -
Quote:
So that when it's retrieved from history it appears on the command line as exactly as entered initially.
Thanks
Alex
Code:echo "alex" | while read LINE
do
EDIT_STRING=$(echo alex | grep "${LINE}" )
if [[ ! -z "$EDIT_STRING" ]];then
echo $EDIT_STRING
mktemp aik.XXXXXX
fi
doneit ends up in the history file as
Quote:
echo "alex" | while read LINE; do EDIT_STRING=$(echo alex | grep "${LINE}" ); if [[ ! -z "$EDIT_STRING" ]];then echo $EDIT_STRING; mktemp aik.XXXXXX; fi ; done |
Quote:
echo "alex" | while read LINE; do EDIT_STRING=$(echo alex | grep "${LINE}" ); if [[ ! -z "$EDIT_STRING" ]];then echo $EDIT_STRING; mktemp aik.XXXXXX; fi ; done |
Is there a way in bash to replicate the ksh behavior whereby the command would be stored in history exactly as entered i.e. -
Quote:
805 echo "alex" | while read LINE do EDIT_STRING=$(echo alex | grep "${LINE}" ) if [[ ! -z "$EDIT_STRING" ]];then echo $EDIT_STRING mktemp aik.XXXXXX fi done |
Thanks
Alex