#!/bin/bash
export LANG=C
for n in $(zypper sl -u | egrep "^[0-9\ ]{1,3}" | expand | tr -s " " | tr " " © | cut -f2,5,6,7 -d\|); do
 echo zypper ar -t $(echo $n | cut -f3 -d\|) $(if [ ${n/Yes/} != $n ]; then echo "-f "; fi) $(echo $n | cut -f4 -d\|) \"$(echo $n | cut -f1 -d\| | tr © _)\"
done | tr © " " | sed -e 's/\"_\(.*\)_\"/\"\1\"/g'
