w2 - CSC209: Shell Scripting Kante Easley University of...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSC209: Shell Scripting Kante Easley University of Toronto May 20, 2009 Kante Easley CSC209 CSC209: Shell Review Shell is the userland process that prints the prompt and interprets your commands. Many shells available: ksh, csh, tcsh, bash, sh, rs, . . . We will use plain-old sh for programming Startup scripts run using sh It’s always available ftp://rtfm.mit.edu/pub/faqs/unix-faq/shell/csh-whynot Prompt, input and parse command, execute command, repeat Kante Easley CSC209 CSC209: Shells sh - Bourne shell Most common shell Other shells are a superset csh/tcsh - c shell. . . c-like syntax good for interactive use (not good for programming) bash - Bourne again shell based on sh with some extra features ksh - Korn shell based on sh - some claim to be best for programming commercial product Kante Easley CSC209 CSC209: Shells on CDF On the CDF network sh is actually bash bash is a superset of sh We will only be learning/using the features of bash that are part of sh Your default CDF shell is tchs. To change this use the command: chsh <user> bash If you want. . . Kante Easley CSC209 CSC209: Simple shell script When given an input file, sh will read the lines of the file and execute them in sequence. Example: lecture 1 files - shellscript mkdir test cd test echo "this is file1" > file1 sed ’s/1/2/’ <file1 >file2 cat > file3 <<EOF this is file3 EOF cd .. ls test > filelist .cshrc/.bashrc is executed each time you log in Kante Easley CSC209 CSC209: Shell variables You can set variables in the shell with: variable_name=value no spaces!...
View Full Document

This note was uploaded on 04/10/2010 for the course CSC CSC209 taught by Professor Kante during the Spring '10 term at University of Toronto- Toronto.

Page1 / 21

w2 - CSC209: Shell Scripting Kante Easley University of...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online