Skip to content

Commit 18aef74

Browse files
committed
Added echo and variables
1 parent ff93ad9 commit 18aef74

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

_episodes/01-unix.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ middle.txt
268268
tail.txt
269269
```
270270

271+
Tip: `>>` operator is used to append to a file.
272+
271273
### Concatenate/Join files
272274

273275
`cat` command is used for concatenation of multiple files.
@@ -281,6 +283,31 @@ $ wc -l concat.txt
281283
15 concat.txt
282284
```
283285

286+
### Print/output to screen
287+
288+
`echo` command can be used to display result to the screen.
289+
290+
```sh
291+
$ echo "hi"
292+
hi
293+
```
294+
295+
### Variables
296+
297+
Variables can be assigned values with `=` operator. Do not use space around `=`.
298+
299+
```sh
300+
$ a="Hello"
301+
302+
$ echo $a
303+
Hello
304+
305+
$ b="World"
306+
307+
$ echo "$a $b!"
308+
Hello World!
309+
```
310+
284311
### Text manipulation
285312

286313
`cut` is used to extract fields of data from a string or a file.

0 commit comments

Comments
 (0)