compsci-missing_semester_2020/_subsections/lesson-02.org
2024-12-02 01:00:50 +02:00

2.6 KiB

lesson 02 | course overview + the shell

Notes

bash

spaces are critical with bash

  • this works:
foo=bar
echo $foo
  • this doesn't:
foo = bar
echo $foo

the output of that will be zsh: command not found: foo

  • what happens in the above example is that we are effectively calling the "foo" program with the arguments: "=" and "bar"

quotes

  • you can use double or single quotes to print a value

    echo "Hello"
    echo 'Hello'
  • double quotes can interpolate variables

    echo "Value is $foo"

    will return: Value is bar

  • single quotes can NOT interpoloate variables

    echo 'Value is $foo'

    will return: Value is $foo