I am looking for a workaround for processes with a long duration. There is the special parameter $_ containing the last parameter of the last command. Well I am asking you for something vice versa.
For example:
/etc/init.d/service stop; /etc/init.d/service start
.. could be easier if there is a parameter/variable containing the last binary/script called. Let's define it as $.
and we get this:
/etc/init.d/service stop; $. start
Do you have any Idea how to get this?
I found this Thread on SO
But I only get output like this:
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"
But the var $BASH_COMMAND is working well:
# echo $BASH_COMMAND
echo $BASH_COMMAND
# echo $BASH_VERSION
4.1.2(1)-release
Any help is very appreciated! Thank you, Florian