#!/bin/bash
f=/etc/passwd
line=`wc -l $f|awk ‘{print $1}‘`
for l in `seq 1 $line`; do
n=`sed -n "$l"p $f|grep -o ‘[0-9]‘|wc -l`;
if [ $n -eq 1 ]; then
sed -n "$l"p $f
fi
done
时间: 2024-10-12 21:21:39
#!/bin/bash
f=/etc/passwd
line=`wc -l $f|awk ‘{print $1}‘`
for l in `seq 1 $line`; do
n=`sed -n "$l"p $f|grep -o ‘[0-9]‘|wc -l`;
if [ $n -eq 1 ]; then
sed -n "$l"p $f
fi
done