Unix/Linux Go Back    


What is on Your Mind? Come inside and relax a while. Discuss whatever is on your mind. New members can introduce themselves. However, technical Q&A should happen in our other forums.

Should we use CODE Tags for terminal input and output?

What is on Your Mind?


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-17-2014   -   Original Discussion by Michael Stora
Michael Stora's Unix or Linux Image
Michael Stora Michael Stora is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 22 June 2015, 3:25 PM EDT
Posts: 183
Thanks: 56
Thanked 15 Times in 13 Posts
Should we use CODE Tags for terminal input and output?

I've always used code tags for code but not for showing terminal input and output. I noticed a mod edited one of my threads and now I'm confused as to proper protocol.

Mike
Sponsored Links
    #2  
Old Unix and Linux 07-17-2014   -   Original Discussion by Michael Stora
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 June 2018, 6:37 PM EDT
Location: Saskatchewan
Posts: 22,696
Thanks: 1,183
Thanked 4,334 Times in 3,995 Posts
Yes, use them for terminal input and output as well.

It's better than setting random colors and fonts, or labelling them with
----------------output starts here-------------------------
...or letting people guess where it begins and ends.
Sponsored Links
    #3  
Old Unix and Linux 07-18-2014   -   Original Discussion by Michael Stora
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 20 June 2018, 7:52 AM EDT
Location: Lancashire, UK
Posts: 3,556
Thanks: 1,566
Thanked 698 Times in 626 Posts
It's also important because multiple spaces will get compressed in 'normal' text, but are respected within code tags.

This is an "X" with fifteen spaces, then another "X" in normal text:-
X X

This is an "X" with fifteen spaces, then another "X" in code tags:-


Code:
X               X

It's much better for clarity of indented code and for crucial fixed-width data.


Thanks for asking Linux
Robin
    #4  
Old Unix and Linux 07-18-2014   -   Original Discussion by Michael Stora
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 20 June 2018, 9:25 PM EDT
Location: San Jose, CA, USA
Posts: 11,325
Thanks: 640
Thanked 3,944 Times in 3,371 Posts
In addition to what has already been said, CODE tags use a fixed width font. So text like:
iiiiiiiiii
WWWWWWWWWW
which looks like very different line lengths without CODE tags, clearly show that they contain the same number of characters when that same text is displayed using CODE tags:


Code:
iiiiiiiiii
WWWWWWWWWW

And, if your code or data contains tab characters, those tabs are preserved if you copy and paste text from regions of a post that are tagged by CODE or ICODE tags, but copy as spaces when not tagged.

So, yes: always use code tags for full line sample code, input, and output; and use icode tags for partial line, imbedded sample code, input, and output!
Sponsored Links
    #5  
Old Unix and Linux 07-18-2014   -   Original Discussion by Michael Stora
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 June 2018, 6:37 PM EDT
Location: Saskatchewan
Posts: 22,696
Thanks: 1,183
Thanked 4,334 Times in 3,995 Posts
It also prevents random sequences of characters from unintentionally becoming smilies.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
12. If an ‘88’ Record with BAI Code ‘902’ was found on input file and not written to Output file, re sgoud UNIX for Dummies Questions & Answers 0 07-06-2011 07:30 AM
how to check the user input from terminal mskart UNIX for Dummies Questions & Answers 6 11-30-2008 01:15 PM
Is my terminal input secure? pnp Security 2 08-14-2008 06:48 AM
Don't show keyboard input on terminal marianor31 Shell Programming and Scripting 1 03-23-2007 06:54 PM
How to suppress input keying from displaying on terminal. liteyear18 UNIX for Dummies Questions & Answers 2 07-19-2001 09:13 AM



All times are GMT -4. The time now is 10:55 PM.