[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: udev: Directory for custom device nodes.



Nils Philippsen wrote:
how about this "xargs for the poor" (could be changed a bit and put
into /etc/init.d/functions):

--- 8< ---
FILES=/etc/sysconfig/makedev.d/*.nodes
MAXNR=100
COMMAND="MAKEDEV -x"

NR=$MAXNR
ARGS=""
cat $FILES | while read line; do
    if [ "$NR" -gt 0 ]; then
        ARGS="$ARGS $line"
        NR=$[$NR - 1]
    else
        $COMMAND $ARGS
        NR=$MAXNR
        ARGS="$line"
    fi
done
if [ -n "$ARGS" ]; then
    $COMMAND $ARGS
fi
--- >8 ---

Nils

what about this one? :) for i in /etc/sysconfig/makedev.d/*.nodes; do MAKEDEV -x $(cat "$i") done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]