LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 09-02-2015, 09:46 AM   #1
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Percent symbols in posts sometimes require escape sequences, sometimes do not


Bear with my characterizations, I expect to post, reply, reply again, and then edit the second reply, and then probably post a fourth message to summarize.

I noticed that a percent symbol I used as part of a reply was missing. "Oops!" have to escape that, I originally thought with the backslash, but instead I needed to double it by using "percent-percent" and that worked.

Later I re-edited my edit because I corrected something and I reminded myself "double percent's" and (swear word) it put up the double! So I iterated and by that point it seemed to recognize the single use. But ... I did my first edit because it obliterated a single use ....

So as I say. This post will contain a test single percent, and then a double percent.

Reply #1 will just be a simple reply using the same test cases.

Reply #2 will be an advanced editor use reply using the same test cases.

Reply #3 will be a summary.

And I'm sitting here ready to eat crow and just finalize by clicking [SOLVED] if I'm all full of (junk) when the testing is complete.

Single percent %
Double percents %%

---------- Post added 09-02-15 at 10:47 AM ----------

Well both cases worked in my original

Single percent %
Double percents %%
 
Old 09-02-2015, 09:48 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882

Original Poster
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Reply #1 worked also.

Advanced editor.

Single percent %
Double percent %%
 
Old 09-02-2015, 09:49 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882

Original Poster
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Solved! Or I assume either it was some anomaly, or I'm just crazy.

Or the actual syntax of +%u had some impact to the case. That would be PLUS PERCENT LOWERCASE-u
 
Old 09-02-2015, 09:51 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Yup, see Problem displaying % character in posts and within code tags.

Quick reply/edit eats a percent, "advanced" mode does not.
 
2 members found this post helpful.
Old 09-02-2015, 09:52 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i noticed this random phenomena too.

a lot of my solutions using something like date +Y-%j get messed up.
 
Old 09-02-2015, 09:53 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882

Original Poster
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930


 
Old 10-20-2015, 11:50 AM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,792

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
See this thread
The deletion of percent signs happens in the Quick-editor, not in the Advanced-editor.
 
Old 10-20-2015, 12:02 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882

Original Poster
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Sorry, I marked as solved but didn't state any conclusions. I did see the other thread, I think also referenced earlier, and see that the subject was addressed already.
 
Old 10-27-2015, 11:32 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
is there any way to solve it?
http://www.linuxquestions.org/questi...7/#post5440794
 
Old 10-27-2015, 12:02 PM   #10
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
Quote:
Originally Posted by pan64 View Post
It's a known issue that will be addressed in a future code upgrade.

--jeremy
 
Old 10-27-2015, 01:28 PM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Quote:
Originally Posted by jeremy View Post
It's a known issue that will be addressed in a future code upgrade.

--jeremy
Better sooner than later, please Jeremy: this bug could even hurt a poster's reputation (I mean, real reputation).

For instance in this post,
Code:
echo ${YES%+*}
became
Code:
echo ${YES+*}
So readers maybe thought: either Didier can't write a simple shell script or he didn't take care of trying it before posting.

PS I realize that such a change on a website with a very high load needs thorough testing before being put in production "in the wild". I volunteer to participate to these tests as an end user who can devote some time to such a task.

Last edited by Didier Spaier; 11-02-2015 at 09:36 AM. Reason: PS added.
 
1 members found this post helpful.
Old 11-02-2015, 06:26 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Didier is right to highlight the risks here. Having the percent signs silently ripped from a ${parameter%word} or ${parameter%%word} substitution in a posted shell-script example could potentially do much more harm than just making the poster look like an idiot.

This is somewhat contrived and not a particularly good/safe coding style to start with, but take the following example of a not entirely unreasonable installation routine (minus the echo's which I've thrown in just to be 100% safe):
Code:
newdir=something_new
echo rm -rf /${newdir%_new}
echo mv /${newdir} /${newdir%_new}
Stripping those percent signs could be quite catastrophic if the poster or reader didn't catch the omission!
 
Old 02-09-2016, 04:07 PM   #13
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
I'm happy to report that a fix to this issue has been rolled out. I appreciate the patience. A big thanks to Stuart Langridge for the pointer that ended up leading to the solution.

--jeremy
 
2 members found this post helpful.
Old 02-14-2016, 04:58 AM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Thanks!
 
  


Reply

Tags
bug testing



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
escape sequences in a string oshin159 Linux - Newbie 2 11-11-2013 02:53 AM
Less outputs ANSI escape sequences sprocketboy Mandriva 2 08-05-2009 08:22 PM
escape sequences in enscript lanco Linux - Newbie 1 03-01-2009 02:32 PM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 11:37 AM
Xterm escape sequences GrayGh0st Linux - Software 3 07-19-2003 12:10 AM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration