[arch-general] [arch-dev-public] [RFC] Rewrite early RTC device creation
Andres P
aepd87 at gmail.com
Tue Jun 8 22:21:55 EDT 2010
On Tue, Jun 8, 2010 at 9:23 PM, Dan McGee <dpmcgee at gmail.com> wrote:
> We can also just do some bash string manipulation and leave sed out of
> the picture:
>
> devnum=$(cat /sys/class/rtc/rtc0/dev)
> /bin/mknod /dev/rtc0 c ${devnum/:/ }
>
Since you're already using a ${foo/bar/baz} bashism, that's a useless
use of cat:
devnum=$(< /sys/class/rtc/rtc0/dev)
And the subshell is also unnecesary:
read -r devnum < /sys/class/rtc/rtc0/dev
The second one is posix...
Andres P
More information about the arch-general
mailing list