I have a server where I have different kinds of scripts.
Those scripts are to be opened with different shells such as:
sh ./do_one_thing.sh
bash ./do_another_thing.sh
the .sh
extension is dangerous to me especially if I have not connected to the server for a longer time. Or if someone unfamilliar needs to do a stand-in.
I might accidently execute sh ./do_another_thing.sh
Will it make any difference if I name my script do_another_thing.bash
? This would create one more layer of foolproofness.
Additionally, I would like to know what the shebang line in the beginning is for other than a reminder to the Admin (#!/bin/bash
) if it get's overwritten by sh ./do_another_thing.sh
anyways. It seems to me such that there must be a more proper way of executing the script, recogniting the shebang.