[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to exclude results from PS0\1 \ PROMPT_COMMAND
From: |
ikhxcsz7y xmbott |
Subject: |
Re: how to exclude results from PS0\1 \ PROMPT_COMMAND |
Date: |
Fri, 12 Mar 2021 15:07:04 +0100 |
thank you,
i dont do much, i have to experiment way more to know what all the vars and
cases do
i was trying to complete my prompt, also i cant say for sure what im on
about
i just observed PS0 gets printed by every command also in PROMPT_COMMAND so
i wondered how to exclude such
it was also only one var assiignment in the prompt
-- cut -- sorry its a bit off the project but i wanted to answer you, sadly
i cant write exactly whaht i mean into words here - im sorry
in short
a) exclude cmds from display system
a.2) possibly by having a list of patterns to excllude then cutting those
off of $BASH_COMMAND
a.2.1) then on PS* use ${var:+format here}
.. thanks yo
On Fri, Mar 12, 2021, 14:46 Aleksey Tsalolikhin <atsaloli.tech@gmail.com>
wrote:
> Sorry, what are you trying to do? Normally to change what one sees before
> the prompt one would change PROMPT_COMMAND.
>
> See
>
> https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html
>
>
>
> On Thu, Mar 11, 2021 at 11:17 AM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
> wrote:
>
> > i tried, print $user_cmd in PS0 which is set by PROMPT_COMMAND
> > user_cmd=$BASH_COMMAND but it runs twice, once for my interactive entered
> > command, but also for the bash prompt command line
> >
> > how to exclude such ? must i grep -v the whole or something ?
> >
>
>
> --
> Achieve real learning. Email training@verticalsysadmin.com.
>