#!/bin/bash # I want to turn $@ into a string which can be used to match # the trailing end of the zsh history line and delete it. # eg. $@=" 1105 cat FILE" # # HISTFILE_LINE= ": 1686640384:0;cat FILE" str="$(echo "$@" | awk '{$1=""}1' | colrm 1 1)" LC_ALL=C sed -i "/$str$/d" $HISTFILE # STDOUT sed: no input files