Eseguire un comando ad ogni prompt

From RVM Wiki
Revision as of 09:12, 13 June 2006 by Gabriele.vivinetto (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.