Relative Content

Tag Archive for bash

Calling “history -s” prevents function call from being added to history

Problem I want to append an item to history from a function, but don’t want to run it. So from inside the function I call history -s. This works, but causes the function call itself to not be added to the history file. Example: $ test123() { history -s ‘echo “here”‘; } $ test123 “args” […]