Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
scripting:debuggingtips [2015/08/07 04:19]
bill_thomson
scripting:debuggingtips [2016/05/13 15:52]
federated_brackets [Why do CRs hurt?] rewording for accuracy
Line 270: Line 270:
   * UNIX(r) uses: ''​\n''​ (ASCII ''​LF''​ #10)   * UNIX(r) uses: ''​\n''​ (ASCII ''​LF''​ #10)
  
-Keep in mind your script ​**is a plain text file**, and the ''​CR''​ character means nothing special to UNIX(r) - it is treated like any other character. If it's printed to your terminal, a carriage return will effectively place the cursor at the beginning of the //current// line. This can cause much confusion and many headaches, since lines containing CRs are not what they appear to be when printed. In summary, CRs are a pain.+Keep in mind your script is a **plain text file**, and the ''​CR''​ character means nothing special to UNIX(r) - it is treated like any other character. If it's printed to your terminal, a carriage return will effectively place the cursor at the beginning of the //current// line. This can cause much confusion and many headaches, since lines containing CRs are not what they appear to be when printed. In summary, CRs are a pain.
  
 ==== How did a CR end up in my file? ==== ==== How did a CR end up in my file? ====
Line 277: Line 277:
   * a DOS/Windows text editor   * a DOS/Windows text editor
   * a UNIX(r) text editor that is "too smart" when determining the file content type (and thinks "//​it'​s a DOS text file//"​)   * a UNIX(r) text editor that is "too smart" when determining the file content type (and thinks "//​it'​s a DOS text file//"​)
-  * a direct copy&paste from certain webpages (some pastebins are known for this)+  * a direct copy and paste from certain webpages (some pastebins are known for this)
  
  
Line 306: Line 306:
  
 <note warning> <note warning>
-It's easy tp imagine the ''​^M''​ is bad in other places too. So if you get weird and illogical messages from your script, ​chances are good ''​^M''​ is envolved. Find and eliminate it!+It's easy to imagine the ''​^M''​ is bad in other places too. If you get weird and illogical messages from your script, ​rule out the possibility that''​^M''​ is involved. Find and eliminate it!
 </​note>​ </​note>​
  
  • scripting/debuggingtips.txt
  • Last modified: 2017/06/07 02:42
  • by fgrose