| Summary: | abnormally behavior of bash | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | igor ivanov <algaraad> |
| Component: | RPM Packages | Assignee: | Shlomi Fish <shlomif> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | basesystem, mageia, marja11, shlomif |
| Version: | 6 | ||
| Target Milestone: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | MGA5TOO | ||
| Source RPM: | bash-4.3-33.1.mga5 bash-completion-2.1-9.mga5 | CVE: | |
| Status comment: | |||
but:
alias echotest3='echo "a";
echo "b";
echo "c"'
alias echotest4='echo "a" &&
echo "b" &&
echo "c"'
echotest3 gives
a
echotest4 gives
a
b
c
That looks pretty normal shell scripting to me. Do you have a reference that says that Bash should work differently? Source RPM:
bash-4.3-33.1.mga5 bash-completion-2.1-9.mga5 bash-4.3-33.1.mga5 =>
bash-4.3-33.1.mga5 bash-completion-2.1-9.mga5 (In reply to Rémi Verschelde from comment #2) > That looks pretty normal shell scripting to me. Do you have a reference that > says that Bash should work differently? yes, on my old mageia4, I have not discarded, echotest1 gives a b c didn't try echotest3 OK, some news:
1. On my default Mageia 6 x86-64 user, all these aliases work fine. OTOH, on Mageia 5 x86-64, I was able to reproduce the offending behaviour. This seems strange to me because Mageia 5 and Mageia 6 carry the same versions of bash, glibc, and coreutils - only with a different kernel.
2. On a new user ("kdetest") on Mageia 5 x86-64, then I get the offending behaviour with the default .bashrc and .bash_profile and do not get that after I move them away.
3. I'll investigate further.
Some more news - I discovered this only happens in Mageia 5 x86-64 if the TERM environment variable is set to "xterm" on Bash's startup. If you remove it from the environment, then everything is fine. Regards, -- Shlomi Fish Apparently ncurses is the same version in Mageia 6 and Mageia 5 too, so I still don't know what is particularly broken on Mageia 5. OK, now I am getting it in a different "kdetest" user on Mageia 6 x86-64 with TERM=screen. so I even more don't know what the problem is now. Here's another thing that I found: [shlomif@localhost ~]$ echotest1 a [shlomif@localhost ~]$ unset PROMPT_COMMAND [shlomif@localhost ~]$ echotest1 a b c [shlomif@localhost ~]$ echotest1 So the problem appears to be with the PROMPT_COMMAND. congratulations, but the way to keep it permanent? (In reply to igor ivanov from comment #10) > congratulations, but the way to keep it permanent? One way is to add "unset PROMPT_COMMAND" to the bottom of your ~/.bashrc . But this is a problem that should be fixed more globally. (In reply to Shlomi Fish from comment #11) > (In reply to igor ivanov from comment #10) > > congratulations, but the way to keep it permanent? > > One way is to add "unset PROMPT_COMMAND" to the bottom of your ~/.bashrc . > But this is a problem that should be fixed more globally. it works well, but it's only a patch An update: I tested it and the problem disappears if I remove the $(perl ... -e ' ... ') from the PROMPT_COMMAND and persists if it only has this there: $(perl -e 'print "Foobar"') This means we may need to get rid of our use of perl there and replace it with something else.
Samuel Verschelde
2016-11-01 13:26:37 CET
CC:
(none) =>
basesystem Hi Igor, Thank you for having taken the needed time to report this issue! Hi Shlomi, Thanks for the debugging :-) @ All: Did this bug get fixed? If so, please change its status to RESOLVED - FIXED If it didn't, then we regret that we weren't able to fix it in Mageia 5. Mageia 5 has officially reached its End of Life on December 31st, 2017 https://blog.mageia.org/en/2017/11/07/mageia-5-eol-postponed/ It only continued to get important security updates since then, because we are waiting for a big Plasma5 update in Mageia 6, that'll fix many of the Mageia 5 => 6 upgrade issues. If you haven't seen that this bug got fixed, then please check whether this bug still exists in Mageia 6. If it does, then please change the Version (near the top, at the left) to "6". If you know it exists in Cauldron, then change Version to Cauldron. If you see it in both Cauldron and Mageia 6, then please set Version to Cauldron and add MGA6TOO on the Whiteboard. Thanks, Marja CC:
(none) =>
marja11 (In reply to Marja Van Waes from comment #14) > Hi Igor, > > Thank you for having taken the needed time to report this issue! > > Hi Shlomi, > > Thanks for the debugging :-) > > @ All: > > Did this bug get fixed? If so, please change its status to RESOLVED - FIXED > > If it didn't, then we regret that we weren't able to fix it in Mageia 5. > Mageia 5 has officially reached its End of Life on December 31st, 2017 > https://blog.mageia.org/en/2017/11/07/mageia-5-eol-postponed/ > It only continued to get important security updates since then, because we > are waiting for a big Plasma5 update in Mageia 6, that'll fix many of the > Mageia 5 => 6 upgrade issues. > > If you haven't seen that this bug got fixed, then please check whether this > bug still exists in Mageia 6. If it does, then please change the Version > (near the top, at the left) to "6". If you know it exists in Cauldron, then > change Version to Cauldron. If you see it in both Cauldron and Mageia 6, > then please set Version to Cauldron and add MGA6TOO on the Whiteboard. > > Thanks, > Marja this bug is fixed, provided you add to .bashrc the following line: unset PROMPT_COMMAND (In reply to igor ivanov from comment #15) > > this bug is fixed, provided you add to .bashrc the following line: > unset PROMPT_COMMAND That doesn't sound like fixed to me, that sounds like a workaround. Does that line still need to be there when you use Mageia 6, too? Anyway, in the Cauldron I'm using now, echotest1, 2, 3 and 4 all work as desired, both in Xfce and in a VT (tty3), without needing a workaround (In reply to Marja Van Waes from comment #16) > (In reply to igor ivanov from comment #15) > > > > > this bug is fixed, provided you add to .bashrc the following line: > > unset PROMPT_COMMAND > > That doesn't sound like fixed to me, that sounds like a workaround. Does > that line still need to be there when you use Mageia 6, too? > > Anyway, in the Cauldron I'm using now, echotest1, 2, 3 and 4 all work as > desired, both in Xfce and in a VT (tty3), without needing a workaround sorry, but if the line "unset PROMPT_COMMAND" is commented (i.e. disabled) I get: [alain4@mageia5_64 ~]$ echotest1 a [alain4@mageia5_64 ~]$ echotest2 a b c [alain4@mageia5_64 ~]$ echotest3 a [alain4@mageia5_64 ~]$ echotest4 a b c in both mageia5 & 6 hence the bug is not yet fixed I added the MGA6TOO Keyword. Btw i tested in cauldron and this is fixed. CC:
(none) =>
mageia and i confirm this is broken on mageia 6 (In reply to Nicolas Lécureuil from comment #18) > I added the MGA6TOO Keyword. > > Btw i tested in cauldron and this is fixed. (In reply to Nicolas Lécureuil from comment #19) > and i confirm this is broken on mageia 6 Thanks, Nicolas :-) Changing the version to 6 then, and setting MGA5TOO, because we always set bug reports to the highest affected version ;-) Whiteboard:
MGA6TOO =>
MGA5TOO (In reply to Nicolas Lécureuil from comment #18) > Btw i tested in cauldron and this is fixed. Trying on Mageia 7: $ cat .bashrc ... alias echotest='echo "a" echo "b" echo "c"' ... $ echotest a b c Resolution:
(none) =>
FIXED |
Description of problem: when writing a serie of command separated by a line return as separator, only the first command is executed Version-Release number of selected component (if applicable): How reproducible:in your .bashrc, type the following alias: alias echotest1='echo "a" echo "b" echo "c"' alias echotest2='echo "a"; echo "b"; echo "c"' when typing in a terminal echotest1, the result will be a when typing in a terminal echotest2, the result will be a b c Steps to Reproduce: 1.kwrire .bashrc 2.type in .bashrc the two alias above 3.close any already opened terminal, open a new terminal and successively type echotest1 echotest2 and see the result Reproducible: Steps to Reproduce: