Eseguire un comando ad ogni prompt: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
Line 21: Line 21:


Ogni volta che si preme invio al prompt, vengono eseguiti questi comandi.
Ogni volta che si preme invio al prompt, vengono eseguiti questi comandi.
== Riferimenti ==
*[http://www.debian-administration.org/articles/205 Debian Administration :: Fancy Bash Prompts:]

Latest revision as of 09:15, 13 June 2006

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.

Riferimenti