sinebubble
IS-IT--Management
I'm stuck trying to execute a command w/in an awk statement. I've pieced together a string with awk, but I need to execute the string as a command ($lynx_url). Suggestions?
#!/bin/sh
HOST=HTTP=http://
LYNXCMD="/usr/local/bin/lynx"
LYNX="$LYNXCMD -dump -head"
while read LINE
do
node=`echo $LINE | sed 's/=/./' | cut -f 3 -d "."`
markets=`echo $LINE | cut -f 2 -d "="`
URL="${HTTP}${HOST}/${node}";
echo $markets | awk -F"," '{
for (x=1;x<=NF;x+=1) {
lynx_url="/usr/local/bin/lynx -dump -head '$URL'"$x"/report.txt\n";
# How to get this next line to work?
$lynx_url > /tmp/HTTP.$$ 2>&1;
}
printf "\n"; }'
done < awk.txt
#!/bin/sh
HOST=HTTP=http://
LYNXCMD="/usr/local/bin/lynx"
LYNX="$LYNXCMD -dump -head"
while read LINE
do
node=`echo $LINE | sed 's/=/./' | cut -f 3 -d "."`
markets=`echo $LINE | cut -f 2 -d "="`
URL="${HTTP}${HOST}/${node}";
echo $markets | awk -F"," '{
for (x=1;x<=NF;x+=1) {
lynx_url="/usr/local/bin/lynx -dump -head '$URL'"$x"/report.txt\n";
# How to get this next line to work?
$lynx_url > /tmp/HTTP.$$ 2>&1;
}
printf "\n"; }'
done < awk.txt