LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   error in alsaconf script (http://www.linuxquestions.org/questions/slackware-14/error-in-alsaconf-script-207565/)

rgiggs 07-20-2004 05:38 PM

error in alsaconf script
 
hi,
when i run alsaconf as a normal user, i see this error:
Code:

/usr/sbin/alsaconf: line 35: [: too many arguments
/usr/sbin/alsaconf: line 37: [: too many arguments
You must be root to use this script.

when i run as root, alsaconf pops up the color screen so i can't see if it still gives the first 2 lines as errors.
i don't remember seeing the first 2 lines as errors before. i don't think it's important, so i removed those two elif's and the errors are gone. but i wonder why it suddenly has errors. this is my /usr/sbin/alsaconf (the red lines are lines 35 and 37 have errors as above):
Code:

# Check for GNU/Linux distributions
if [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]; then
  distribution="suse"
...
elif [ -f /etc/redhat-release -a `grep -c "Red Hat" /etc/redhat-release 2>/dev/null` -ne 0 ]; then
  distribution="redhat"
elif [ -f /etc/fedora-release -a `grep -c "Fedora" /etc/fedora-release 2>/dev/null` -ne 0 ]; then
  distribution="fedora"
else
  distribution="unknown"
fi


shilo 07-21-2004 12:27 PM

It may sound silly, but you said that you removed the two elif's; did you also remove the "distribution=" lines? If not, the script will improperly set your distribution. You could change this:

Code:

# Check for GNU/Linux distributions
if [ -f /etc/slackware-version ]; then
  distribution="slackware"
elif [ -f /etc/SuSE-release -o -f /etc/UnitedLinux-release ]; then
  distribution="suse"
elif [ -f /etc/gentoo-release ]; then
  distribution="gentoo"
elif [ -f /etc/debian_version ]; then
  distribution="debian"
elif [ -f /etc/mandrake-release ]; then
  distribution="mandrake"
elif [ -f /etc/redhat-release -a `grep -c "Red Hat" /etc/redhat-release 2>/dev/null` -ne 0 ]; then
  distribution="redhat"
elif [ -f /etc/fedora-release -a `grep -c "Fedora" /etc/fedora-release 2>/dev/null` -ne 0 ]; then
  distribution="fedora"
else
  distribution="unknown"
fi

To this:

Code:

# Check for GNU/Linux distributions
if [ -f /etc/slackware-version ]; then
  distribution="slackware"
else
  distribution="unknown"
fi

I don't know why you received the error, but there shouldn't be any problem changing the script. You'll also want to check and make sure that /etc/slackware-version still exists on your system. I'm just guessing here, but you might also want to check that /etc/redhat-release and /etc/fedora-release do'nt exist on your system. I don't know why they would, but if you are having trouble with those two lines, that would be something to look at.

Hope that helps,

rgiggs 07-21-2004 12:42 PM

Quote:

Originally posted by shilo
It may sound silly, but you said that you removed the two elif's; did you also remove the "distribution=" lines?
of course.
yeah i'll change it to the slackware only conditional. thanks.


All times are GMT -5. The time now is 08:02 PM.