Picking a MAC address for a FreedomBox
Picking a MAC address for a FreedomBox
Posted Dec 8, 2012 17:24 UTC (Sat) by rahulsundaram (subscriber, #21946)In reply to: Picking a MAC address for a FreedomBox by mathstuf
Parent article: Picking a MAC address for a FreedomBox
--
#! /bin/bash
/bin/macchanger -r wlan0 2>&1 > /dev/null
--
That's all it takes.
Posted Jan 21, 2013 16:52 UTC (Mon)
by mcortese (guest, #52099)
[Link] (3 responses)
Posted Jan 21, 2013 19:00 UTC (Mon)
by rahulsundaram (subscriber, #21946)
[Link]
Posted Jan 22, 2013 0:32 UTC (Tue)
by dlang (guest, #313)
[Link] (1 responses)
Posted Jan 22, 2013 1:04 UTC (Tue)
by ABCD (subscriber, #53650)
[Link]
No it isn't. To see the difference, compare the following:
Picking a MAC address for a FreedomBox
The redirection looks weird: stdout goes to null, while stderr goes to stdout! ;-)
/bin/macchanger -r wlan0 2>&1 > /dev/null
Picking a MAC address for a FreedomBox
Picking a MAC address for a FreedomBox
Picking a MAC address for a FreedomBox
command 2>&1 >/dev/null first copies fd 1 to fd 2 (thus sending stderr to where stdout is currently going), then sets fd 1 (stdout) to /dev/null. The standard "show me nothing" line is command >/dev/null 2>&1, which sets fd 1 to /dev/null, then copies fd 1 to fd 2.
$ to_stderr() { echo "$@" >&2; }
$ to_stderr test 2>&1 >/dev/null
test
$ to_stderr test >/dev/null 2>&1
