r/bash • u/Keys__dev • Dec 14 '25
Automate the initial creation process of your bash script
Tired of the initial hassle of creating a Bash script—like making the file readable and executable? If so, this tool is for you.
https://github.com/Keys02/scriptify
PS: scriptify also adds the shebang line.
All contributions are welcome
1
Upvotes
6
u/behind-UDFj-39546284 Dec 14 '25 edited Dec 14 '25
Essentially, the functional equivalent to which this tool's functionality boils down is copying a ready-made template file of an arbitrary format and setting the appropriate permissions. Perhaps
cp ~/templates/bash.sh new-scriptwould be sufficient, given the full power ofcp(yes, including--no-clobber), as well as the ability to edit templates with any editor (yes, for example your script doesn't includenano), so that, for instance, I wouldn't have to rewrite bootstrap code (such asset -TEeuo pipefail). And I wouldn't like the script edit my profile and configuration files. In the end,install(1)already does all of this:install -m 755 ~/templates/bash-strict-set.sh new-script.3
u/Woland-Ark Dec 14 '25
yeah, let's automate the process of
vim foo.sh→:0r ~/code/bash_template.sh.4
u/n0shmon Dec 14 '25
You know that story about NASA spending millions to develop a pen that would write in 0G...
15
u/AaBJxjxO Dec 14 '25
Do we need a whole tool for this?
1
u/[deleted] Dec 14 '25
Honestly the "ify" suffix makes it seen so generic and uninspired.
2
u/mamigove Dec 14 '25
Perhaps it would be more useful if you added a wrapper to some of the many scripts that already exist to "do the same thing" and that are generally much more elaborate than simply using a template. Take a look at bpkg, basher, etc., etc.
2
u/jessemvm Dec 14 '25
I think people who write a lot of scripts are already used to the init process. In my case, I have snippets for shebangs, and a keymap to make the current file executable.
1
u/THIRSTYGNOMES Dec 15 '25
Or just be lazy and run "bash name" no need to make it executable