User Tools

Site Tools


2018cmd_list

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
2018cmd_list [2018/09/04 15:06]
david [Syntax]
2018cmd_list [2018/09/07 10:33] (current)
david [Syntax]
Line 2: Line 2:
  
 ====== A running list of BASH commands, syntax, and environmental variables ====== ====== A running list of BASH commands, syntax, and environmental variables ======
 +This page will be updated with new concepts for each lecture.
 +
  
 ===== Commands ===== ===== Commands =====
Line 36: Line 38:
  
 ^ Keyword(s)/​Operators ​     ^ Description ​ ^ Example ^ ^ Keyword(s)/​Operators ​     ^ Description ​ ^ Example ^
 +^  9/4/18 - Scripting, executable permissions/​conventions. ​                                  |||
 | ''​[ ]'' ​                  | conditional ​ | ''​[ -z ""​ ]'' ​ | | ''​[ ]'' ​                  | conditional ​ | ''​[ -z ""​ ]'' ​ |
 | ''​if,​then,​else,​fi'' ​      | flow control | ''​if [ -z ""​ ]; then echo '​empty!';​ else echo 'NOT empty!';​ fi''​ | | ''​if,​then,​else,​fi'' ​      | flow control | ''​if [ -z ""​ ]; then echo '​empty!';​ else echo 'NOT empty!';​ fi''​ |
 | ''​test'' ​                 | flow control | ''​test -z ""''​ | | ''​test'' ​                 | flow control | ''​test -z ""''​ |
 | ''&&​ ||'' ​                | boolean operators for flow control | ''​[ -z ""​ ] && echo '​empty!'​ || echo 'NOT empty!'''​ |  | ''&&​ ||'' ​                | boolean operators for flow control | ''​[ -z ""​ ] && echo '​empty!'​ || echo 'NOT empty!'''​ | 
 +^  9/​6/​18 ​                                                                       |||
 +| ''​let'' ​                  | arithmetic assignment ​ | ''​a=1;​ let a=a+1;''​ |
 +| ''​$<​nowiki>​((expr))</​nowiki>'' ​            | arithmetic expressions | ''​echo <​nowiki>​$((a+1))</​nowiki>'' ​ |     
 +| ''​while'' ​                | loop           | ''<​nowiki>​a=0;​ while [ $a -lt 10 ]; do echo $a; let a=a+1; done</​nowiki>''​ | 
 +| ''​for var in list'' ​      | loop           | ''<​nowiki>​for num in 1 2 3; do echo $num; done</​nowiki>''​ |
 +^  9/​11/​18 ​                                                                      |||
2018cmd_list.1536095164.txt.gz ยท Last modified: 2018/09/04 15:06 by david