You are not logged in.
Hi,
I have this code on my rc.local file:
for tty in /dev/tty[1-6]; do
/usr/bin/setleds -D +num < "$tty"
done
But it doesn't work, numlock leds are not enabled nor does the numpad outputs numbers...
What am I doing wrong?
Offline
I think the right expansion syntax is :
for tty in tty{1..6}; do /usr/bin/setleds -D +num < "/dev/$tty"; done
Offline
nope - he is ok; just try this:
for f in /dev/tty[1-6]; do echo $f; done
Offline
I tried that before and it outputs /dev/tty1, /dev/tty2, etc...
I also tried the command directly in bash like:
setleds -D +num < /dev/tty1
and
setleds -D -num < /dev/tty1
But the led doesn't turn on or off anyways and I yes, I made sure I was on TTY1
Offline
nope - he is ok; just try this:
for f in /dev/tty[1-6]; do echo $f; done
You are right this syntax gives the same output as :
for f in /dev/tty{1..6}; do echo $f; done
As to why the setleds command doesn't set the numlock, I don't know.
The command seems to work on my PC.
Offline
Maybe it's something to do with the fact that I'm running Arch in VirtualBox? Now that I think of it... If numlock is enabled on the guest, I come to the host and disable it, go back to the guest and it remains disabled where it should become enabled cause that's how it was when I got out of the guest.
Offline