Bug 459381 - KDialog odd behavior escaping exclamation mark
Summary: KDialog odd behavior escaping exclamation mark
Status: RESOLVED NOT A BUG
Alias: None
Product: kdialog
Classification: Applications
Component: general (other bugs)
Version First Reported In: 22.08.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Brad Hards
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-19 10:41 UTC by Sadi
Modified: 2022-09-22 17:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sadi 2022-09-19 10:41:44 UTC
SUMMARY
***
KDialog displays escaped exclamation mark from terminal but not from a shell script.
***


STEPS TO REPRODUCE
1. Enter a terminal command like this: kdialog --title "Conversion" --passivepopup "The file has been \"converted\" now\!"
2. Copy and paste this command into an empty executable shell script file, and run the script file from the terminal.

OBSERVED RESULT
1. Terminal command results in this message text, as expected: The file has been "converted" now!
2. The script, however,  results in this message text: The file has been "converted" now\!
Additionally, the following terminal message appears:  Unrecognized escape sequence \!

EXPECTED RESULT
Escaping the exclamation mark like other characters (e.g. double quotation mark) should work in script files as well as entering it directly in terminal.  

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Comment 1 Brad Hards 2022-09-19 11:41:36 UTC
This is not a KDialog issue.

The difference in behaviour is due to using different shells. If you want to have bash behaviour in your shell script, run it in bash (not dash or whatever other shell you are using).
Comment 2 Sadi 2022-09-19 15:50:03 UTC
(In reply to Brad Hards from comment #1)
> This is not a KDialog issue.
> 
> The difference in behaviour is due to using different shells. If you want to
> have bash behaviour in your shell script, run it in bash (not dash or
> whatever other shell you are using).

I use zsh but this behavior doesn't change even if it's named *.sh and its first line is like this: #!/usr/bin/env bash
I ruled out that because KDialog --progressbar doesn't work with zsh but it works if I do as above.
BTW, is the progress bar issue also zsh issue, and not KDialog issue?
Thanks.