<dermoth>
Of course I could've done without the eval by doing "exec </proc/meminfo" but the original script I wrote at work runs a command to get AFS stats...
_whitelogger has joined ##bash-crimes
dermoth has quit [Ping timeout: 260 seconds]
dermoth has joined ##bash-crimes
dermoth has quit [Ping timeout: 260 seconds]
dermoth has joined ##bash-crimes
mei[m] has joined ##bash-crimes
<mei[m]>
does plain `exec < <(cat /proc/meminfo)` not work? is this like, a thing to make the polyglot work?
<mei[m]>
and in any way, I think putting the awk in a heredoc would be considered more conventional
<mei[m]>
so yes, wonderfully cursed, 10/10, please don't inflict it upon your coworkers without their consent
<dermoth>
"exec < <(cat /proc/meminfo)" would be a syntax error. The "((0)) && ..." block doesn't run in awk but lines must be proper awk syntax regardless. Then I use an awk regex ("/.../") to insert a shell-only comment so that bash doesn't see the "{" and passes on to the next lines.
<dermoth>
Yeah, cursed, but easier than writing a vim syntax file to format the heredoc as awk. :)
_whitelogger has joined ##bash-crimes
<dermoth>
Not if you execute a subshell - not needed in this case but as I said it was a demo, the script I originally wrote runs "eval "exec < <(xstat_cm_test \"$HOSTNAME\" 2 -onceonly)"" which isn't something a lot of people here will have handy, starting with myself - I don't have any AFS server at home :)