I am trying to write a bash alias to execute a command, and echo it as well. Tried various methods mentioned in StackOverflow and other places, but nothing seems to work for this scenario.
My current alias (a much shortened example) is:
alias abc='__abc() { xyz -n $1 -m $2;}; __abc'
But, this doesnt echo the whole command making it difficult to understand what exact command was run.
Few ways I want to run the command:
abc 100 200
Add optional params:
abc 100 200 -o 300 -pp
And I expect the whole command including the optional params to be printed. So, it should print something like:
Executing: xyz -n 100 -m 200 -o 300 -pp
Please let me know if there is a way to do it. Thanks!