8
qwwerty
2y

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...
  • -1
    The script file seems to have been inserted after the contents of the.bash_history file had been manually executed, command by command. https://survivor-io.io
  • 0
    It's frustrating when you're aware of potential issues, but convincing others to adopt better coding practices can be a difficult task.
Add Comment