Hi
I am trying to write a function that needs to be able to assign the last run shell command to a variable. The actual command string itself not the exit code of the command.
I am using the bash command recall ability to do this as follows:
alias pb='ps | grep ash' #Last command string entered
VAR1="!!" #Method used to catch the last command string
Although this does work to capture the last run command, I have a feeling this is not very efficient.
Does anyone here have any suggestions or comments?
Thanks