[kwlug-disc] Capturing output in scripts

Bob Jonkman bjonkman at sobac.com
Tue Aug 26 20:53:15 EDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14-08-26 05:47 AM, Giles Malet wrote:
> On 14-08-21 03:27 PM, William Park wrote:
>> 
>> exec [...] 2>&1 1>/tmp/logfile
> 
> Order is significant as this is evaluated left to right, so you
> need to redirect 1 before 2, else 2 is left pointing at what 1
> *originally* was. Thusly:
> 
> exec 1>/tmp/logfile 2>&1


So if it's evaluated left to right doesn't _your_ incantation mean
"Send STDOUT to /tmp/logfile, then STDERR to STDOUT (which is now
/tmp/logfile)"?


(Or is that what you intended, and I've lost track of the orginal
question from lack of context?)

- --Bob.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Ensure confidentiality, authenticity, non-repudiability

iEYEARECAAYFAlP9K/MACgkQuRKJsNLM5eo3FQCffNgpc+DhaTSwXMtU5ImY0aUA
lFQAn1EqQJvmU8qMVEfz9kQi01FuQj+d
=RQcN
-----END PGP SIGNATURE-----





More information about the kwlug-disc mailing list