4 ms·
I'm not making fun of your bash, a lot of bash one-liners are, essentially, tongue-in-cheek and not intended for daily use. What I take issue with is the arbit
by 22c 4y ago
I'm not making fun of your bash, a lot of bash one-liners are, essentially, tongue-in-cheek and not intended for daily use.
What I take issue with is the arbitrary point made by the post I replied to that using oathtool is somehow not "bash one-liney", whereas your attempt is somehow "bash one-liney".
Could I make a bash one-liner that uses a rube goldberg machine of echo, netcat, dd, ed etc. to make a HTTP request? Yeah I could, or I could just use curl and it's also still a valid "bash" one-liner.
- jsjohnst 4y ago`curl` is a command `curl | awk …` is a “shell one-liner” (albeit very basic) Throw in some $(()), ${var:##}, etc and it’s a great example of a “bash one-liner”
- maratc 4y ago> Could I make a bash one-liner that uses a rube goldberg machine of echo, netcat, dd, ed etc. to make a HTTP request? Yeah I could Can you paste your bash one-liner here? As previously, I’m interested in seeing your Rube Goldberg machine, and mainly for adoration, not practical use. `curl`, as previously, would not qualify.
- 22c 4y agoThe basics is something like `printf "GET /\r\n" | nc neverssl.com 80` (interestingly this is considered a HTTP 0.9 request, which HTTP 1.0 compliant servers need to handle). Add in few useless pipes to cat and dd, and you got yourself a Rube Goldberg machine.
- jsjohnst 4y ago> interestingly this is considered a HTTP 0.9 request, which HTTP 1.0 compliant servers need to handle For GP, the reason this is an HTTP/0.9 request is because it doesn’t specify a version number on the GET line (HTTP/1.0 would require that to be “GET / HTTP/1.0\r\n\r\n”). HTTP/0.9 was the “one-line” version of HTTP before headers and such were added. Not sure if @22c intended the pun there, but if so, we’ll played!