[問題] bash 新手. 請幫我看程式寫的對不對
#!/bin/bash
# Passwd file format:
# root:x:0:0:root:/root:/bin/bash
#
# Purpose: Check if remote machines have more than one uid=0 account
#
for host in ma01 ma02
do
COUNT=`ssh $host "cat /etc/passwd | awk '{if ($3 == 0) print $0}' | wc -l "`
if [ $COUNT -gt 1 ]
then
echo "$host : More than one uid 0 account!"
fi
done
不好意思...想請問. 我這樣寫..對不對呢?
謝謝大家了.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 201.102.180.60
→
11/25 13:05, , 1F
11/25 13:05, 1F
→
11/25 15:43, , 2F
11/25 15:43, 2F