Subject: Re: MAKEDEV prob
To: Andrew Brown <atatat@atatdot.net>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 05/08/2003 18:08:50
On Wed, May 07, 2003 at 09:23:25AM -0400, Andrew Brown wrote:
> >>ugen*)
> >> unit=${i#ugen}
> >> ugen=ugen$unit
> >> major=64
> >> for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
> >> do
> >> ugenj=$ugen.$j
> >> rm -f $ugenj
> >> mknod $ugenj c $major $(($unit * 16 + $j))
> >> chmod 600 $ugenj
> >> done
> >> ;;
> >>...
> >>So, that (s/ 0/ /) needs changing in nearly every ports' MAKEDEV (!)
> >...
> >But then the device nodes will no longer be named as before.
> >Is there any way to force it to decimal?
>
> who cares? just remove all the leading zeroes, and add this:
>
> j=$(echo 0$j | sed 's/.\(..\)/\1/')
>
> above the line that says:
>
> ugenj=$ugen.$j
>
> and the problem goes away. :)
Did you see the elegant solution that went in? (!) never thought of that...
Patrick