I need to create a bash script that combines multiple matches from different files. All files are included in the directory with the same extension (.desktop). Here is an example:
[Desktop Entry] Icon=text-x-c++src Name=button.cpp Type=Link URL[$e]=file://$HOME/Configs/button.cpp X-KDE-LastOpenedWith=kate
Matches are URL, LastOpenedWith, Name and Icon. Each of them should be stored in another variable (for example, $ Name, $ URL, etc.), Which will be printed in an XML file, according to this sintax:
<action label="$Name" icon="$Icon" exec="$LastOpenedWith $URL"/>
Create separate entries for all .desktop files.
I do not know how to do this, since I start with bash scripts, any feedback would be welcome :)
source share