I. Common Uses of CAT
1. Summary
2. Experiments
(1). Non-interactive editing
[Email protected] ~_~ day5]# cat > Cattest.sh <<stop
> Hello
> STOP
[Email protected] ~_~ day5]# cat cattest.sh
Hello
[Email protected] ~_~ day5]# cat > cattest.sh << EOF
Hello Cat with EOF
Eof
[Email protected] ~_~ day5]# cat cattest.sh
Hello Cat with EOF
[Email protected] ~_~ day5]# cat > cattest.sh << ~_~
> HDHHDHDHHDHD
> ~_~
[Email protected] ~_~ day5]# cat cattest.sh
Hdhhdhdhhdhd
(2). Clear the contents of the file
[Email protected] ~_~ day5]# cat cattest.sh
Hdhhdhdhhdhd
[Email protected] ~_~ day5]# cat/dev/null > cattest.sh
[Email protected] ~_~ day5]# cat cattest.sh
(3). Merging
[Email protected] ~_~ day5]# cat > Cattest.sh <<eof
> Hello
> EOF
[Email protected] ~_~ day5]# cat > Cattest2.sh <<eof
> World
> EOF
[Email protected] ~_~ day5]# cat cattest.sh cattest2.sh >newfile.sh
[Email protected] ~_~ day5]# cat newfile.sh
Hello
World
[Email protected] ~_~ day5]# cat newfile.sh
Hello
World
Two. Common options for CAT commands
1. Summary
Use of the Shell Foundation--cat command