输入脚本
#!/bin/bash
#文件名:interactive.sh
read -p "Enter number:" no;
read -p "Enter name:" name
echo You have entered $no ,$name;
文本交互 通过echo -e来生成序列
echo -e "1\nhello\n" |sh interactife.sh
使用文档作为输入来源
sh interactife.sh <input.data
生成文件的md5值脚本
#!/bin/bash
#文件名:generate_checksums.sh
PIDARRAY=()
for file in text1.txt text2.txt testsplit.file
do
md5 $file &
PIDARRAY+=("$!")
done
wait ${PIDARRAY[@]}