I have this line: ALSA=`aplay --version`
in a script. when I execute the script I get the message line 187: --version: command not found
when I do "aplay --version" on the command line it works just fine.
What is happening here, --version is a valid command line option?
Thanks,
jerry
Jerry Geis wrote:
I have this line: ALSA=`aplay --version`
in a script. when I execute the script I get the message line 187: --version: command not found
$ echo $(aplay --version) aplay: version 1.0.18 by Jaroslav Kysela perex@perex.cz
t
I have this line: ALSA=`aplay --version`
in a script. when I execute the script I get the message line 187: --version: command not found
What's in line 187?
Do you really want to use backticks ` or should it be more like ALSA='aplay --version' (apostrophes)? If you want to stick to the backticks you should redirect aplay's output from STDERR to STDOUT: ALSA=`aplay --version 2>&1` (aplay 1.0.6, CentOS 4.7).
Chris
On Thu, Jun 4, 2009 at 9:47 AM, Jerry Geisgeisj@pagestation.com wrote:
I have this line: ALSA=`aplay --version`
in a script. when I execute the script I get the message line 187: --version: command not found
when I do "aplay --version" on the command line it works just fine.
What is happening here, --version is a valid command line option?
Thanks,
jerry _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
I tested it (mind you on a Fedora system as I don't have my CentOS partition booted) and it works fine. You can test it by doing a very, very short bash file with only that command in it along with the #!/bin/bash and see if that works. If that works, then you know that it should work. Other trouble shooting steps would be to make sure that line 187 is indeed that line (that should be your first trouble shooting step really). As someone else pointed out, what is line 187? Run the command: head -n 188 your_script | tail -n 3
That will output lines 186-188 so that you have some context (in case the line before is causing grief for some reason as a result of a missing quote or some such thing). If indeed that is the offending line then copy/paste those lines to this group so that others can look at the exact syntax.
Jacques B.
On Thu, Jun 4, 2009 at 10:27 AM, Stephen Harrislists@spuddy.org wrote:
On Thu, Jun 04, 2009 at 10:11:37AM -0400, Jacques B. wrote:
head -n 188 your_script | tail -n 3
That will output lines 186-188 so that you have some context (in case
sed -n 186,188p your_script
:-)
--
rgds Stephen
Got to learn sed, got to learn sed ...
Thanks,
Jacques B.