|
From: | Mart Frauenlob |
Subject: | Re: [Help-bash] play audio-CD in consol |
Date: | Wed, 30 Jan 2013 08:25:43 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
On 30.01.2013 01:26, Gerard ROBIN wrote:
On Tue, Jan 29, 2013 at 02:52:19PM +0100, Mart Frauenlob wrote:Date: Tue, 29 Jan 2013 14:52:19 +0100 From: Mart Frauenlob <address@hidden>
[...]
if ! ((! cpt && run ? ++cpt : 0)); then alsaplayer ... filike this is better: if ((! cpt && run ? ++cpt : 0)); then ...
I put the negation because you didn't have any commands executed but cpt=$(( $cpt+1 )), which now is inside the conditional evaluation.
there is one thing I do not understand, is how to use the variable PROMPT_COMMAND and what is the advantage rather than using the prompt function
PROMPT_COMMANDIf set, the value is executed as a command prior to issuing each primary prompt.
So if you put in: PROMPT_COMMAND="printf 'alsaplayer> '" it should do the same as your prompt function. But maybe this is an option for you? x="$PS1" PS1="alsaplayer> " your_commands_whatever PS1="$x" # reset if needed Best regards Mart
[Prev in Thread] | Current Thread | [Next in Thread] |