[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] play audio-CD in consol
From: |
Matthew Cengia |
Subject: |
Re: [Help-bash] play audio-CD in consol |
Date: |
Wed, 30 Jan 2013 06:54:14 +1100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Please see comment below.
On 2013-01-29 14:52, Mart Frauenlob wrote:
[...]
> >
> >echo -e "\n"$center$frame"\n" $center$title"\n"$center$frame
> >
> >echo -e "\n\tListen to audio CDs with alsaplayer
> >(http://www.alsaplayer.org/)"
> >echo -e "\n\tFirst of all you must edit the ~/.alsaplayer/config
> >\tComplement or add the following lines:
> >\n\t 1 cdda.cddb_servername=freedb.freedb.org
> >\t 2 cdda.cddb_serverport=8880
> >\t 3 cdda.device=/dev/sr0 # replace /dev/sr0 by the good path of your box.
> >\t 4 cdda.do_cddb_lookup=true"
> >
> >echo -e "\n\t\tTo play a CD, type: play, then Enter
> >\t\tTo exit alsaplayer, keep playing, type exit and Enter
> >\t\tTo stop the CD, if it is playing, type stop and Enter
> >\t\tEnter ? for more help"
> >
>
> hard to read, I'd prefer printf, or here-document redirection here.
>
Regarding the above, I would go so far as to almost *mandate* printf. I
realise this is a Bash mailing list, but, as part of good coding
practice (mostly in case you find your script running in a non-bash
shell:
06:51 <mattcen> !echo
06:51 <greybot> echo outputs a string. echo has many portability problems, and
should never be used with option flags. In POSIX shells, use:
`printf '%b\n' "args"' or `printf %s "args"' for -e and -n
respectively. For ksh-like shells other than Bash: print
-[r|n].
http://wiki.bash-hackers.org/commands/builtin/echo |
http://cfajohnson.com/shell/cus-faq.html#Q0b |
http://www.in-ulm.de/~mascheck/various/echo+printf
--
Regards,
Matthew Cengia
signature.asc
Description: Digital signature