Here's the script:
#!/usr/bin/ksh
Date=`date +%m%d%y`
CDate=`date`
FileName=cintas_hosts_and_users.$Date
echo $CDate >> $FileName
#echo $FileName
for host in `cat /collect/itthomp/cintas_hostnames.dat`
do
echo $host >> $FileName
ssh $host "awk -v Fname=$FileName -F: '{if($1 != "root" && $1 != "daemon" && $1 != "bin" && $1 != "sys" && $1 != "adm" && $1 != "uucp" && $1 != "guest" && $1 != "nobody" && $1 != "lpd" && $1 != "lp" && $1 != "invscout" && $1 != "snapp" && $1 != "ipsec" && $1 != "nuucp" && $1 != "pconsole" && $1 != "sshd" && $1 != "idsldap" && $1 != "sapadm")print $1 "\t" $5 >> Fname}' /etc/passwd"
done
Here's the error I get:
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
Syntax Error The source line is 1.
The error context is
{if( >>> != <<<
I'm not very experienced with scripting and this is my first attempt at using awk within a ksh script. Any help please would be appreciated. Thanks...