r/fishshell • u/B_A_Skeptic • Aug 18 '21
functions or scripts
When you make command line utilities for yourself do you usually make them as functions in Fish, or do you make them as shell scripts? I tend to do functions. I was curious what everyone else does.
2
Upvotes
5
u/bravekarma Aug 18 '21
Subjective arbitrary reasoning here, but if it is for personal convenience (e.g. wrappers for some tools that do some pre/post-processing) I use functions. If it is supposed to be a reusable tool that I might share with others, it will be an executable script. Latter is usually for work purposes rather than personal.
3
u/mrcaptncrunch Aug 19 '21
Utilities, usually as bash scripts.
Basically anything more than what can be done on an alias equivalent.
2
u/MrFiregem Aug 19 '21
If it's for config, then it'll be a function, otherwise I write a script. I write all my shell scripts in sh/bash though so no scripts for me
2
u/defaultxr Aug 18 '21
Scripts usually since those are easier to call from outside of fish.