Skip to content

Commit

Permalink
shell输入输出重定向
Browse files Browse the repository at this point in the history
  • Loading branch information
taoshihan1991 committed Mar 26, 2016
1 parent 62ffeda commit 02f6236
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Input.sh
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 # 禁止输出的作用

0 comments on commit 02f6236

Please sign in to comment.