6 ms·
Any tool can be dangerous in inexperienced or careless hands. The issues you described could just as likely be caused by logic errors or typos in any other lang
by __ryan__ 4y ago
Any tool can be dangerous in inexperienced or careless hands. The issues you described could just as likely be caused by logic errors or typos in any other language.
You’re talking as if all bash scripts are hacked together carelessly and work by accident. You can actually learn bash. Thankfully the script we’re discussing is written with care and vetted by the community.
Problems like removing a large directory instead of a file
The rm command doesn’t even remove directories by default, you have to specify a flag. Not knowing a tool is not a good reason to bash it.
- marcosdumay 4y agoIsn't Rust one of those languages based on the idea that tools matter and that should either be correct or obviously wrong? (And no, those problems do usually not appear due to logic errors or typos in other languages. It's very, very rare.) I'm well aware that the Rust installation script is well vetted and stable enough to be reliable. Bootstraping a development environment is also a real problem, with no good answers. It's understandable that they want to bootstrap from Bash. But as understandable as it is, it still carries the Bash issues with it. Of course, the optimum solution would be to do it from your system's tools. That is something that will probably happen naturally given enough time.
- maccard 4y ago> Isn't Rust one of those languages based on the idea that tools matter and that should either be correct or obviously wrong? It doesn't really matter, if you combine `/home/myuser` and some unsantized input variable, and then call `remove_dir_all` [0], it doesn't matter how safe the language is, you're going to delete your entire home directory with absolutely no warning, whether it's in bash, go, python, rust or haskell. Yes bash makes this very easy to do, but so does pretty much every language in existence. > (And no, those problems do usually not appear due to logic errors or typos in other languages. It's very, very rare.) They absolutely do. Here's an explosive script in golang (deliberately doesn't compile just in case) - running this in func main() will ruin your day most likely. dirToRemove := "~/" + os.Getenv("BAD_ENV_VAR") os.RemoveAll(dirToRemove I can write one of these in bash, python, go, you name it. [0] https://doc.rust-lang.org/std/fs/fn.remove_dir_all.html https://doc.rust-lang.org/std/fs/fn.remove_dir_all.html