Linux-[angle brackets] in bash

Linux angle brackets : “<>”
Linux angle brackets: part-1
Linux angle brackets: part-2

1. Pushing around

1
2
3
4
5
6
7
8
9
10
$ ls > content.txt
$ pwd >> content.txt

$ cat nba.txt
kobe lakers 25
james lakers 27
jordan bulls 29

#逐行读取各个字段: while read ...
$ while read name team score; do echo $name-$team-$score;done < nba.txt

2. tr

translate characters: copies the standard input to the standard output with substitution or deletion of selected charaters.

1
2
3
4
5
6
7
8
$ echo "hello world" | tr '[a-z]' '[A-Z]'
HELLO WORLD

$ echo "hello world" | tr '[:lower:]' '[:upper:]'
HELLO WORLD

$ echo "hellow world" | tr -d 'eo'
hll wrld