#!/bin/bash
IFS=:
while read name pass uid gid gecos home shell
do
echo "******************************************"
echo "name : $name"
echo "pass : $pass"
echo "uid : $uid"
echo "gid : $gid"
echo "gecos : $gecos"
echo "home : $home"
echo "shell : $shell"
done
命令行:
# ./showpash.sh < /etc/passwd