From 26841edbe4158832f26f02fbfbf8569f0ec8df7d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 01 Apr 2012 03:11:29 -0400 Subject: Add notes on NJIT ACM UNIX shell workshop. --- (limited to 'shell-workshop/shell-tut.txt') diff --git a/shell-workshop/shell-tut.txt b/shell-workshop/shell-tut.txt new file mode 100644 index 0000000..0a73cb0 --- /dev/null +++ b/shell-workshop/shell-tut.txt @@ -0,0 +1,126 @@ +first steps and basic output + how shell reads input - three methods + use of "echo" built-in utility + ex: hello world +simple commands, field splitting, and quoting + ex: maybe cd, mkdir/touch, etc. +tilde and pathname expansion + ex: cd with tildes + ex: cd/mkdir/touch with pathname expansions +parameters + defining variables and expanding their values + positional parameters, special parameters, and shell variables + ex: assign variables + ex: expand and print variables and positional parameters +command substitution + ex: commands in subshells, output assigned to variables +arithmetic expansion + ex: some expressions, assignments, etc. +shell commands + revisit simple commands + command search and execution + pipelines + lists + sequential + asynchronous + AND + OR + compound commands + grouping + subshell vs current shell, shell execution environment: + open files + working directory + shell parameters + shell functions + shell options + shell aliases + if + show "test"/"[" command + while + ex: loop over positional parameters + #! /bin/sh + while [ $# -gt 0 ]; do + printf '%s\n' "$1" + shift + done + ex: read from input + until + for + case + functions +exit status +I/O redirection +built-in utilities + colon + export + break [n] + continue [n] + dot + eval + exec + exit + export + return + set + shift + unset +utilities + cat + cd + chgrp + chmod + chown + cp + date + dd + df + diff + dirname + du + echo + expr + false + file + fold + getopts + grep + head + id + kill + ln + lp + ls + mailx + mesg + mkdir + mkfifo + more + mv + nice + pr + printf + ps + pwd + read + rm + rmdir + sed + sh + sleep + sort + stty + tail + test + time + touch + tr + true + uniq + wc + who + +example scripts: + screen-batt + /usr/local/lib/pjrand.sh and /usr/local/bin/screensaver + /bin/which of Debian (ex. of IFS) + changelog-gen -- cgit v0.9.1