Feature creep in scripts

Sigh, does anyone else find themselves doing this? Deciding to automate something by writing a “little” bash script… it’s simple, it works as initially intended… BUT

Oh, I could make it do xyz…
… and I could add a help command line option
… and a version number option so I know I have the latest on this computer
… and I could add colours to the messages/output so it’s easier to follow
… it only works on “abc” base distros, but I could add a bit so it will work on “def” and “geh” based distros
… I could see if it can detect the current distro type
… etc.

And before I know it my nice “little” 25 - 50 line script is 250 lines (and I’m still thinking I could add features I can think of, but probably never use).

Does anyone else do this, or is it just me that has no self control and is unable to quit, but keeps tinkering with things.

@TerryL this made me smile. I’m horrible at bash scripting. I basically know how to list one command after another, but I haven’t figured out logic yet. However, my programming son keeps showing me his cool scripts so I don’t just have feature creep (where my son basically tells me what to type into my simple bash scripts) I have script envy when I look at his cool stuff. I enjoy having my script help desk often sitting next to me in our basement Linux man cave. He tends to treat me kindly since his old man introduced him to Linux, the terminal, and vim.

1 Like

My scripts are nothing to write home about, but I manage with the help of this to get them working. 15 - 25 years ago when I was developing for Sun or HP-UX servers I was better but even then had my mate Alex (real Unix guru type) to turn to for the fancy stuff. I handed in my “geek card” over 11 years ago when I retired and became a “mere user”.

Keep trying, create yourself a play directory and on a rainy Sunday just noodle about tying stiff, one step at a time.

EDIT: Use ‘shellcheck’ to check your scripts for errors, I love this app, sort of ‘lint’ for shell scripts.

while true; do
tinker
done

I usually try to make things simpler by making them harder or trying to make use of bad regular expressions to turn what should be a script into a one line paragraph of a command …

I have problems with the ‘done’ part, they never seem to be and the ‘tinker’ bit goes on forever…

2 Likes

It can be a lot of fun to refactor and (hopefully) improve things but yeah, sometimes I can spend hours making something work and then realize how trivial a thing it is and question whether it was worth it. Scripting is one of those power user things that really lets you make a system yours so in the end, if I learn something I guess it’s worth it. :man_shrugging: