This Bash script is designed to quickly and efficiently create new Bash scripts with executable permissions and a shebang line.
Opens the new script in a text editor of your choice after the file creation for a quick start.
- Adds the Shebang Line.
- Set executable permission for your user.
- Adds a file extension to the filename.
- Prevents overwriting existing files.
- Open the script in your favorite text editor.
./mkscript.sh <script_name>
./mkscript.sh <script_name> py
(add "py" arg for python script, else it will default to .sh bash script file extension).
Put this script in your PATH, for eg. /usr/local/bin and remove '.sh' extension so you can run this without './'
cp mkscript.sh mkscript
sudo mv mkscript /usr/local/bin
./mkscript.sh my_script This will create a file named my_script.sh, make it executable, add a shebang line, and open it in vim.
Clone the repository to your local machine:
git clone https://github.com/0Reab/bash-script-creator.git
Navigate to the script directory:
cd bash-script-creator
Make the script executable:
chmod +x mkscript.sh
Customize the script to use your text editor.
Use your hardcoded absolute paths to binaries and else, for better security.
