rc.wireless tr error ?
I just installed Slack 13.37 on my laptop. Happy me :)
When reading the boot log, I realized there may be a little 'bug' in the rc.wireless file, causing an error 'tr: extra operand [A-F]'.
The buggy command is :
So I read the tr man, then the "info coreutils 'tr invocation'", and here's what I read:
- shouldn't the brackets be removed from the command in rc.wireless ? Even going further, shouldn't the command be tr abcdef ABCDEF ?
- why is this command interpreted differently at boot time and in bash ?
- am I being a bee f***er ? (sorry, french literal translation for 'being too finicky')
Yes, they should.
I'm not sure (but the [ and ] will be treated as literals which explains why it still looks like it works when you run it manually),
And no you're not, though use of the f word is undesirable here on LQ.
As it happens, the tr can be avoided completely as sed can be asked to do the upper-case conversion by adding a "\U"
P.S. Good spot though.
Yeah 3 questions, but the 3rd was more rhetorical. Starred the f word though ;)
Ok for the difference between boot/bash. Can commands inputs/outputs be interpreted differently depending on the shell one's using ?
And btw, what's the shell used at boot time, sh ? Or it's not really a shell ?
Thanks for your answers, and the sed switch, gonna edit my file.
Maybe slack14 will incorporate your changes.
The shell being used should be bash, but invoked as /bin/sh which does change some of it's behaviour. But even so, I don't understand what was upsetting tr on your system as the error should have been harmless. Most odd.
Ok, i created a test user with the /bin/sh shell instead of /bin/bash, and the command is showing the error.
So 'tr' parameters are not interpreted the same way in bash and sh.
Thanks for pointing that out to me !
PS : the error was in fact harmless, as my wireless card was properly working. The HWADDR var is even not needed for my setup, as im not using the rc.wireless.conf file. Can as well comment the line.
I was just trying to understand & suppress the error message (dont like them).
From a newbie perspective, the wpa_supplicant integration is not as clear as the rc.* scripts are.
I wish the whole WPA thing could be configured from ONLY the rc.wireless/rc.wireless.conf files (so without a wpa_supplicant.conf file). From what I read and understood in AlienBOB's WPA guide, it's not possible. But me noob, so maybe I wasn't getting the whole point. Now I messed a bit more with the files, I'm gonna re-read this guide.
But now I think about it, I read in slack14 changelog (search for "rc.wireless" in http://slackware.com/changelog/current.php?cpu=i386 ):
If you use the rc.wireless.conf file for wireless settings, and you dont write them in the generic case ($HWADDR in *), rather in the card-specific blocks ($HWADDR in xx:xx:xx), as the $HWADDR is not set, the script may not find the correct parameters, as never entering any case ?!
My 2 cents.
|All times are GMT -5. The time now is 07:11 PM.|