sh shell history contains \040 and \012 characters. Is there any way to dealt with so that sysutils/hstr can use this history?
sh shell history contains \040 and \012 characters.
Is there any way to dealt with so that sysutils/hstr can use this history?
# -i : force interactive (otherwise no history available)
# -c : run specified command
# fc : shows history
# -n : suppress history entry numbers
# -l : list history (instead of opening an editor)
# 0 : number of first history entry to list
# -1 : last entry to list (negative indices start counting from the end)
sh -ic 'fc -nl 0 -1 >> ~/.bash_history'
# fc : (!) this is the zsh implementation of fc
# -R : record history events from given file (stdin doesn’t work)
# -I : record only commands that are not yet present in internal history
fc -RI ~/.bash_history