I am having a problem, I am sure it is something very simple that I am over looking but, I can not seem to see it.
So I am trying to loop through an Array, Do some with using the content of each element and then using the element as a file to redirect too.
fullProc=$(grep "WNDP_Server" $1 | grep -v "#" | cut -f 2 | grep -v /nwsys/release/conf/save" | cut -d '/' -f5)
for i in "${fullProc[@]}"
do
echo "$host$HostName" > "$i"
grep "WNDP_Server: * " $1 | grep -v "#" | cut -f 2-3 | grep -v "/nwsys/release/conf/save" | grep -w "$i" | cut -f 2 >> "$i"
grep "WNDP_Port:" $1 | grep -v "#" | grep -w "$i" | cut -f 3 >> "$i"
ProcName=$(grep "WNDP_Server: * " $1 | grep -v "#" | cut -f 2 | grep -v "/nwsys/release/conf/save" | cut -d '/' -f5 | grep -w "$i" | cut -d '.' -f1)
echo "Process: $ProcName" >> "$i"
grep -w "FilterMode:" $1 | grep -v "#" | cut -f 2-3 | grep -w "$i" | cut -f2 >> "$i"
grep -w "Filter:" $1 | grep -v "#" | cut -f 2-3 | grep -w "$i" | cut -f2 >> "$i"
done
What I get is a single file with all the correct information. instead of multiple files each with their corresponding information.
If you need me to clarify this please let me know.
$i is the file name in question.
fullProc