#!/bin/bash for f in $(ls -1 *.desktop) ; do SETTINGS=$(cat $f | grep "Categories" | grep "Settings") LINE="$(cat $f | grep -n "^Categories")" rc=0 rc=$(echo "$SETTINGS" | wc -c) if [ $rc -ne 1 ] ; then NAME=$(echo $f| cut -d "." -f1) #echo "X-GNOME-Settings-Panel=$NAME" >> $f echo "$SETTINGS" NUMLINE=$(echo "$LINE"| cut -d ":" -f1) echo $NUMLINE sed -i '/^Categories/d' $f echo ""$SETTINGS"X-GNOME-Settings-Panel;X-GNOME-PersonalSettings" >> $f fi done