[CentOS] script question

Jacques B. jjrboucher at gmail.com
Thu Jun 4 14:11:37 UTC 2009


On Thu, Jun 4, 2009 at 9:47 AM, Jerry Geis<geisj at 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 at 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.



More information about the CentOS mailing list