3 ms·
This seems like a good way to accidently run abitrary code downloaded from the internet. I can see opening up in an editor as useful shortcut. But actually exe
by georgyo 6y ago
This seems like a good way to accidently run abitrary code downloaded from the internet.
I can see opening up in an editor as useful shortcut. But actually executing code without an executable bit seems a bit more dangerous.
- franciscop 6y agoReally? Last time I downloaded a .js file by accident was never if my memory doesn't fail me (.html I remember a couple). Even if I did, I normally use the UI to manage my files. The only time I might try to do something with the CLI and a JS file is exactly to run `node file.js`, and this is just a convenience.
- trashburger 6y agoWorse, imagine if someone set their shell as the suffix alias for .sh, just to save time on their curl shell pipes... Oh the horror. Suffix aliases should come with a big caveat.
- Spivak 6y agoDon't worry. I got you. alias -s sh='_c(){ curl -sk $1 | sudo bash };_c' Wait. Improved. alias -s sh='_c(){ [[ -f $1 ]] && sudo bash $1 || curl -sk $1 | sudo bash };_c'