Notes for Computer Information Technology 160
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sep21-conditionals.md 439B

September 24 - Conditionals

$ man bash # open the man page for bash
1443g      # go to line 1443 for conditional expressions

Spaces in files and commands

Example: a folder exists "/tmp/foo bar"

Wrong: ls /tmp/foo bar

Correct: ls /tmp/foo\ bar

Also Correct: ls "/tmp/foo bar"

Argument special characters

$ test -z "hello"

$# = 2

$@ = "-z" "hello"

$* = "-z hello"

$0 = test

$1 = -z

$2 = "hello"