From 0e69eb27bc1b18cb17aecfab95ecaf2ba370ba0d Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Thu, 27 Oct 2022 03:18:56 +0200 Subject: [PATCH] Add script to add script --- .bin/script | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .bin/script diff --git a/.bin/script b/.bin/script new file mode 100755 index 0000000..6b36d7d --- /dev/null +++ b/.bin/script @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Script to create script + +if [ -z "$1" ]; then + echo "Script name required" + exit +fi + +path="$HOME/.bin/$1" + +# Prevent overwriting existing script +set -o noclobber + +# Create script +echo "#!/usr/bin/env bash" > "$path" +chmod +x "$path"