Eseguire un comando ad ogni prompt
Jump to navigation
Jump to search
E' possibile eseguire un comando ad ogni prompt settando la variabile
PROMPT_CMD
Esempio:
function promptcmd {
# Is there a text file called _todo in the current directory ?
# Then print your tasks !
if [ -e _todo ]; then
cat _todo
fi
# Write the history immediatly
hystory -a
}
PROMPT_COMMAND=promptcmd
export PROMPT_COMMAND
Ogni volta che si preme invio al prompt, vengono eseguiti questi comandi.