My shop was a HP UX/AIX shop. For applications which my team work on, I have several shell scripts and all are written in ksh.
Now, all of my applications got migrated to Red Hat Linux 7.9 servers.
I have been asked to create a shell script for a relatively complex feature. Since I am not an expert in shell scripting, I think it will take at least 3 weeks for me to develop it.
Question 1. In a modern Linux environment, should I write the shell scripts in bash (Bourne Again Shell) or stick to korn shell ? Or, is there some other shell which I should consider ?
Question 2. In the legacy shell scripts which run on korn shell, I have noticed that there is no shebang like #!/bin/ksh (written at the beginning of the script). In the old HP-UX/AIX servers, the default shell was korn shell, so I guess the scripts just ran on korn shell.
But, isn't it a bad practice not to use shebang ?
I mean, if I decide to use bash scripting language for my shell scripts, isn't it better to use #!/bin/bash at the top of script as the shebang ?
Or is the shebang deliberately skipped to avoid some portability issues?
