9
qwwerty
32d

Do not offer anyone to help them with their scripts, ever.
I had to do something as there were things like "cd $DIR; rm *". No checks if the folder got changed, no qutoes to prevent breaking on spaces. A problem waiting to happen. And it did. We don't know what the script deleted in the wrong folder to this day.
The scripts have no functions, some files have over 50% duplicate code. I was an idiot and thought running it through shellcheck and doing basic prevention of them shooting their own foot would be enough.
And there is no way to convince the guy to start writing the code properly. Should have kept my mouth shut.

Comments
  • 3
    Sounds as if somebody simply did all tasks manually, command after command, and then dropped contents of .bash_history into the script file.
  • 0
    @impune-pl: Scripts written by non-coders almost always look like plain macros. But that most often also makes them super easy to read...
Add Comment