I'm going batty with this seemingly simple array. What I'm trying to do is cat a file and do some ldap lookups.
What I've done is this:
**************************
wUSERS1=`cat usersample | awk -F "/" '{print $5}'\n`;
for h in "${wUSERS1[@]}"
do
echo "$h"
done
**************************
The above works absolutely fine, no problems. I've having issues when I do the following:
**************************
wUSERS1=`cat usersample | awk -F "/" '{print $5}'\n`;
for h in "${wUSERS1[@]}"
do
ldaplookup "$h"
done
**************************
ldaplookup is a bash script I wrote to do queries. I use the script all the time with no problems so I know it works ok. However, doing the above does not work for EACH element in the array. It stops after the first one! I've tried single quotes, double quotes, while statements, and everything else I can think of but I can get the script to perform for each element.
Can someone toss this dog a bone?
Best Regards,
FM
What I've done is this:
**************************
wUSERS1=`cat usersample | awk -F "/" '{print $5}'\n`;
for h in "${wUSERS1[@]}"
do
echo "$h"
done
**************************
The above works absolutely fine, no problems. I've having issues when I do the following:
**************************
wUSERS1=`cat usersample | awk -F "/" '{print $5}'\n`;
for h in "${wUSERS1[@]}"
do
ldaplookup "$h"
done
**************************
ldaplookup is a bash script I wrote to do queries. I use the script all the time with no problems so I know it works ok. However, doing the above does not work for EACH element in the array. It stops after the first one! I've tried single quotes, double quotes, while statements, and everything else I can think of but I can get the script to perform for each element.
Can someone toss this dog a bone?
Best Regards,
FM