summaryrefslogtreecommitdiff
path: root/newscript
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-07-02 14:46:08 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-07-02 14:46:08 +0200
commit54a39b322d1e13911d8f03d533ee1ed1a2af17d5 (patch)
tree37656ec15d0d8bdfc4c2930f72581b8f035d21b0 /newscript
downloadchadscripts-54a39b322d1e13911d8f03d533ee1ed1a2af17d5.tar.gz
chadscripts-54a39b322d1e13911d8f03d533ee1ed1a2af17d5.tar.bz2
chadscripts-54a39b322d1e13911d8f03d533ee1ed1a2af17d5.zip
dump
Diffstat (limited to 'newscript')
-rwxr-xr-xnewscript13
1 files changed, 13 insertions, 0 deletions
diff --git a/newscript b/newscript
new file mode 100755
index 0000000..709d592
--- /dev/null
+++ b/newscript
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+newscript ()
+{
+ if [ -z "$1" ]; then
+ echo "Usage: newscript <script-name>"
+ return 1
+ fi
+ local name=$1
+ cd ~/.scripts && touch "$name" && printf "#!/bin/sh\n\n" > "$name" && vim +2 "$name" && chmod +x "$name" && cd -
+}
+
+newscript $1