-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62ffeda
commit 02f6236
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# shell输入输出重定向 | ||
|
||
# 输出重定向 | ||
echo 123 > users # 会覆盖文件的内容 | ||
echo 456 >> users # 追加 | ||
|
||
# 输入重定向 | ||
wc -l < Ifelse.sh # 计算文件的行数 | ||
|
||
# Here Document | ||
# 计算这段的行数 | ||
wc -l << EOF | ||
你是谁 | ||
我是说 | ||
你是谁 | ||
陶士涵 | ||
EOF | ||
|
||
# 保存进文件 | ||
# filename="test.txt" | ||
# vi filename << EOF | ||
# i | ||
# 你是谁 | ||
# 我是说 | ||
# 你是谁 | ||
# 陶士涵 | ||
# ^[ | ||
# ZZ | ||
# EOF | ||
|
||
# /dev/null 文件 | ||
echo 123 > /dev/null # 禁止输出的作用 |