@vasa1
From what I can see all Exec= lines from the same .desktop file are identical. I could output only the last of them after all Name= lines, like this:
Code:
sed -ns '/^Name=/p;/^Exec=/h;${g;s/$/\n/p}' /usr/share/applications/*.desktop
To get filenames you probably should use awk instead of sed as it has FILENAME variable. The latest GNU sed version 4.2.2 includes new command F just for this, but it's not yet in Debian. In awk, it's something like
Code:
awk '
/^Name=/;
/^Exec=/ {x=$0}
NR!=1&&FNR==1 {printf "%s\nIn: %s\n\n",x,FILENAME}
END {printf "%s\nIn: %s\n\n",x,FILENAME}
' /usr/share/applications/*.desktop
or, if written in one line
Code:
awk -vfmt='%s\nIn: %s\n\n' '/^Name=/;/^Exec/{x=$0}NR!=1&&FNR==1{printf fmt,x,FILENAME}END{printf fmt,x,FILENAME}' /usr/share/applications/*.desktop
Bookmarks