Can I write keyboard shortcut in bash script like:
#!bin/bash echo Hello ^z # this is kbd shortcut
This didn't work. Is there any other way?
It depends on what you want to do. Since you've used ^Z as an example, I assume you're trying to start some command and have it run in the background. Try adding an & at the end of the command instead:
That will set the command to run in the background as a sub-shell and will let your script continue - in this case, it would wait 5 seconds then print the word "Hello". When typed manually in a terminal, it will display the process ID.
Most other terminal keyboard shortcuts should have script equivalents, but some may not. Add them to your question if you want to use other shortcuts as well.