summaryrefslogtreecommitdiffstats
path: root/guides/shell-workshop/shell-tut.txt
blob: 0a73cb0b8bbdfd6b31ab68a726842ea4d734c907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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