Running the below returns for lines of echoed text, but only the first app from the array actually gets touched:
#!/bin/sh
path=/Applications
app[0]="Microsoft Communicator.app"
app[1]="Microsoft Lync.app"
app[2]="Microsoft Messenger.app"
app[3]="Remote Desktop Connection"
IFS=""
for i in ${app[*]}
do
if [[ -a $path/$app ]];
then
chflags hidden $path/$app;
echo "Hiding $app"
fi;
done
exit