histf1=${HISTFILE:-~/.bash_history}
grep_out1=$(grep -iP --binary-files=text "$@" $histf1 | tail -n 80) || [[ $? == 1 ]]
if [[ $EUID == 0 ]]; then
- histf2="/home/iank/${histf1##*/}"
+ histf2="/home/iank/.bh"
grep_out2=$(grep -iP --binary-files=text "$@" $histf2 | tail -n 80) || [[ $? == 1 ]]
elif sudo -nv 2>/dev/null; then
- histf2="/root/${histf1##*/}"
+ histf2="/root/.bh"
grep_out2=$(sudo grep -iP --binary-files=text "$@" $histf2 | tail -n 80) || [[ $? == 1 ]]
fi
if [[ $grep_out1 && $grep_out2 ]]; then