Re:Shelling Out Sucks
by rcthompson on Sunday March 11, 2012 @07:10PM
(#3691560)
Yeah, I kind of figured Haskell would have solved this problem in a way that makes the typical syntax do the right thing (shell-quote the interpolated variables) and then provides an override for those few cases when you're doing something weird.
http://mainisusuallyafunction.blogspot.com/2011/10/shqq-embe...
> λ> let x = "/proc/uptime" in [sh| sha1sum $x |]
> "337ec3fb998fb3a4650a18e0785f0992762b3cda /proc/uptime\n"