linux-tutorial/codes/shell/逻辑控制/使用嵌套循环并修改IFS.sh

16 lines
190 B
Bash
Raw Normal View History

2019-10-29 18:22:19 +08:00
#!/usr/bin/env bash
#changing the IFS value
IFS.OLD=$IFS
IFS=$'\n'
for entry in `cat /etc/passwd`
do
echo "Values in $entry -"
IFS=:
for value in $entry
do
echo " $value"
done
done