I put together a bunch of alias commands in a folder. Mainly ssh, so instead of having to type…
ssh [user]@[server]
…ten times a day, I can just type…
server
…and the alias script fires. The script is simply the command…
ssh [user]@[server]
This is all working fine, but I was wondering if there was a way in Bash where instead of firing the ssh command quietly, it would display the command that is being executed?
You can debug the script with
-x, which will echo the commands and arguments.You can do this for specific portions of the file, too (from section 2.3.2 linked above):
The output from
-xmight be a bit too verbose for what you’re looking for, though, since it’s meant for debugging (and not logging).You might be better off just writing out your own
echostatements – that’d give you full control over the output.