then
cmdno="`set - \`wc -l $histfile\`;echo $1`"
cmdno="`expr \"$cmdno\" + 1`"
- lastcmd="`tail -1 $histfile`"
+ lastcmd="`sed -n '$p' $histfile`"
copy=false
ohist=$histfile
while test ! -w "$histfile"
rest=
;;
esac
- i="`grep \"$wanted\" $histfile | tail -1`"
+ i="`grep \"$wanted\" $histfile | sed -n '$p'`"
;;
*)
# find which 'start-of-command' match is wanted
rest=
;;
esac
- i="`grep \"^$wanted\" $histfile | tail -1`"
+ i="`grep \"^$wanted\" $histfile | sed -n '$p'`"
;;
esac