CS 330 Lecture 1 – Shello
Agenda
- meta
- shell basics
- echo, cat, bc, head, tail, cut, grep
- man pages
- paths
- changing working directories
- shell builtin variables
- tab completion
- interpolation
- custom variables
- reusing output
- PATH
- command-line arguments
Who are you?
- Name?
- Where from?
- Last unassigned book you read?
- If not computers, what?
Setting your shell
I’m not certain what your shell program is. Probably it’s bash or tcsh. bash is prolific, making web searches fruitful when you need help. Let’s not speak of tcsh. My personal favorite shell is zsh. Sadly, I cannot change my shell permanently on our university machines. Instead, I hijack my bash startup files and run zsh instead. To get zsh up and running, I added these lines to my $HOME/.bash_profile:
[ -f /bin/zsh ] && exec /bin/zsh -l
[ -f /usr/bin/zsh ] && exec /usr/bin/zsh -l
TODO
- Read the syllabus.
- Read chapter 13 through section 13.2.1.
- Write and run a script on the CS servers. (Find or learn an editor: vi, emacs, pico, nano, etc. Or mount your H: drive and use a windowed editor.)
- Bring a quarter sheet with two questions and two observations.
TLDL
- Programs are functions.
- The command-line is your editor.
- Shell code is fast to code, not safe.
Haiku
Don’t you double-click
That program will shackle you
Be in command(-line)
That program will shackle you
Be in command(-line)