scripting:basics

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 Both sides next revision
scripting:basics [2015/08/02 04:27]
bill_thomson
scripting:basics [2015/08/02 04:30]
bill_thomson
Line 148: Line 148:
  
 ==== Block commenting ==== ==== Block commenting ====
-To temporarily disable complete blocks of code you would normally have to prefix every line of that block with a # (hashmark) to make it a comment. There'​s a little trick, using the pseudo command '':''​ (colon) and input redirection. The '':''​ does nothing, it's a pseudo command, so it does not care about standard input. In the following code example, you want to test only the things that don't harm (mail, logging) ​but not actually do anything to the system (dump database, shutdown):+To temporarily disable complete blocks of code you would normally have to prefix every line of that block with a # (hashmark) to make it a comment. There'​s a little trick, using the pseudo command '':''​ (colon) and input redirection. The '':''​ does nothing, it's a pseudo command, so it does not care about standard input. In the following code example, you want to test mail and logging, but not dump the database, ​or execute a shutdown:
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
  • scripting/basics.txt
  • Last modified: 2019/08/30 09:07
  • by ersen