1
0 Comments

I have a server where I have a variety of scripts.

These scripts should be opened using a variety of shells, including:

sh./do one thing.sh

bash./do another thing.sh

The .sh extension is risky for me, especially if I haven’t connected to the server in a while. If a stand-in is required, or if someone unfamiliar is required.
I may inadvertently run sh./do another thing.sh.

Is it important that I call my script do_another_thing.bash? This would provide another layer of invulnerability.

Additionally, I would like to know what 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.

It seems to me that there must be a better way to execute the script and recognize the shebang.

Askify Moderator Edited question April 15, 2023