IFS_old=$IFS
IFS=':'
cat /etc/passwd | while read lin
do
for i in $lin
do
echo $i
done
done
IFS=$IFS_old
自己再修改一下
read -p "please input name" IFS
cat /etc/passwd | grep $IFS > ~/1.txt
etc/passwd password | tee -a logs| tail -1 | read IFS
果断用cat查看重定向给一个文本,想咋看就咋看