Bash script that allow the up/down arrow to do history search