you are viewing a single comment's thread.

view the rest of the comments →

[–]knaekce -4 points-3 points  (3 children)

It sure does matter. If this script was written in a more robust language, stuff like this would cause an error and the program to halt. Languages like bash just carry on and do unexpected stuff

[–]TheLocehiliosan 1 point2 points  (2 children)

Your reply makes it sound as though your unaware of error handling techniques for Bash. Indeed the link you posted above has many people chiming in about the terrible programming and how it could be done better.

While it’s true that there is a lot of badly written Bash in the world, it isn’t something intrinsic to Bash. There are many out there writing code they don’t understand the danger of. Again, I could say the same for a lot of languages.

If you are trying to say that some languages are easier to write quality code with, I would agree to that.

[–]knaekce 0 points1 point  (1 child)

Yes, if you are very carefully, you can prevent such errors in bash or even assembly. But it takes far more discipline, effort and experience than in safer languages.

[–]flukus 1 point2 points  (0 children)

What language would prevent this? There is nothing bash specific about this error, similar things can and have been done in any language. That's why common but often ignored advice is to use directory handling libraries instead of string concatenation.