Maja changed the topic of ##bash-crimes to: we bash back | club of folks preoccupied in whether they could, not whether they should | logs https://libera.irclog.whitequark.org/~h~bash-crimes
_whitelogger has joined ##bash-crimes
<dermoth> Tell me... is that a crime?? https://0x0.st/8ERX.sh
<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]> i mean first of all you could just run the subprocess within awk: https://www.gnu.org/software/gawk/manual/html_node/Getline_002fPipe.html
<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 :)
<dermoth> "eval "exec < <(xstat_cm_test \"$HOSTNAME\" 2 -onceonly)""
<dermoth> and it has to be valid *awk* syntax
dermoth_ has joined ##bash-crimes
dermoth has quit [Ping timeout: 260 seconds]
dermoth_ is now known as dermoth
_whitelogger has joined ##bash-crimes