News for hackers. Stuff that matters.
Re:Pure Sh Bible by throwawaaarrgh on Sunday April 30, 2023 @06:52PM (#35767299)
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.

Re:Pure Sh Bible by jethro_tell on Monday May 01, 2023 @12:27AM (#35769087)
Isn'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
Re:Pure Sh Bible by throwawaaarrgh on Monday May 01, 2023 @03:16AM (#35769928)
Programmers 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.