Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.54 KB

File metadata and controls

45 lines (31 loc) · 1.54 KB

Bash-script-creator

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.

Features

  • 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.

Usage

./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).

Efficient Usage

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

Example

Alt Text

./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.

Installation

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

Notes

Customize the script to use your text editor.
Use your hardcoded absolute paths to binaries and else, for better security.