Reading everything stdin in a bash script - Mocking Eye
mardi 6 janvier 2015 à 16:14Oros links 06/01/2015
#!/bin/bash
VALUE=$(cat)
echo "$VALUE"
via https://fralef.me/links/?b0OG1Q
(Permalink)
@jeekajoo shaarlinks 06/01/2015
"""
That’s it! $(cat) is a shorthand for $(cat /dev/stdin), so presumably you can use this to read from stderr by pointing it at /dev/stderr.
"""
(Permalink)
#!/bin/bash
VALUE=$(cat)
echo "$VALUE"
via https://fralef.me/links/?b0OG1Q
(Permalink)
@jeekajoo shaarlinks 06/01/2015
"""
That’s it! $(cat) is a shorthand for $(cat /dev/stdin), so presumably you can use this to read from stderr by pointing it at /dev/stderr.
"""
(Permalink)