msgs=`egrep "$regex" $events_files | wc -l`
jids=`egrep "$regex" $events_files \
- | sed 's/.*<jid>\(.*\)<\/jid>.*/\1/' | sort -u`
+ | sed 's/.*<jid>\(.*\)<\/jid>.*/\1/' \
+ | sort -u \
+ | tr '\n' ' ' \
+ | sed 's/ $//'`
if [ $msgs -eq 0 ]
then
echo "nada nuevo"