Doubled control operators before `alert` will have their second characted appear in the body of the message

Bug #1953151 reported by Akbarkhon Variskhanov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
New
Low
Unassigned

Bug Description

Patch attached below.

[Description]

Separating the first part of a list and the `alert` part with && (or any of the doubled control operators) will result the second character to be printed in the body of a message, for example with:

sleep 5s && alert

notify-send will display the following message:

sleep 5s &

which is obviously undesirable and not intended.

[Suggested fix]

Adding the asterisk after the [;&|] bracket expression fixes it:

alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]*\s*alert$//'\'')"'

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: bash 5.0-6ubuntu1.1
ProcVersionSignature: Ubuntu 5.11.0-40.44~20.04.2-generic 5.11.22
Uname: Linux 5.11.0-40-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.21
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: XFCE
Date: Fri Dec 3 16:56:21 2021
InstallationDate: Installed on 2021-05-17 (200 days ago)
InstallationMedia: Xubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Akbarkhon Variskhanov (kbar) wrote :
description: updated
description: updated
Changed in bash (Ubuntu):
importance: Undecided → Low
Revision history for this message
Akbarkhon Variskhanov (kbar) wrote :
description: updated
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "skel.bashrc.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.