i have created a small script for soalris OS which will check which ethernet card is under DHCP control as below :
for i in `/usr/sbin/ifconfig -a | awk '/flags/ {print $1}' | grep -v lo | sed 's/://g'`
do
echo `ifconfig $i dhcp status`
done >> /tmp/logfile
but this is only creating a logfile at /tmp but not writing the stdout to it.Only stdout is displayed on the promt as below :
ifconfig: e1000g1: interface is not under DHCP control
ifconfig: e1000g1: interface is not under DHCP control
can someone help me to correct if am doing something wrong while re directing for loops output...