Can i edit a bash shell command?
I just wants to modify a bash shell command like exit so when i write exit in the terminal it clears the screen, and echo some text, wait 2 seconds, then execute the exit function.
So is there any way to modify a shell command on Ubuntu, if there is away how ?
You can use a shell alias
alias exit='clear; sleep 2; exit'
To make it permanent, add the alias to the bottom of the ~/.bashrc file. see this thread for help
I have found a workaround instead of editing the exit bash command,trap 'clear; ~/ascii3.sh; spd-say "Exit"; sleep 2' EXIT
by using a trap to the exit in the terminal and i put it in the end of the .pashrc file and it works.
And the ascii3.sh:
echo -e "\033[01;31m" echo " _ _ __ _ _ ____ __ __ _ __ ___ ____ ____ __ _ _ _ " echo "/ )( \ / _\ / )( \( __) / _\ ( ( \( )/ __)( __) ( \ / _\ ( \/ )/ \ " echo ") __ (/ \\\ \/ / ) _) / \ / / )(( (__ ) _) ) D (/ \ ) / \_/ " echo "\_)(_/\_/\_/ \__/ (____) \_/\_/ \_)__)(__)\___)(____) (____/\_/\_/(__/ (_) "
I think the question i asked was a very bad one as it didn't reflect my thoughts but i won't change it nor the answer i just put this answer here for anyone who want it.