4 ms·
Actually, eval, much like global variables (which are maligned by "real programmers" everywhere) actually works fine for a janky shell script. Also, don't use
by throwawaaarrgh 3y ago
Actually, eval, much like global variables (which are maligned by "real programmers" everywhere) actually works fine for a janky shell script.
Also, don't use echo, use printf. echo has different semantics and potential footguns depending on the platform.
- jethro_tell 3y agoIsn't the problem with eval that you are running whatever is in the var? Probably variable expansion but maybe not and that could be not ideal
- throwawaaarrgh 3y agoProgrammers do that without realizing it all the time. There's like five classes of exploits that are just programmers assuming whatever variable they are interpolating is safe because they assume their language handles all security problems for them.