That first suggestion is very helpful. 2 completely irrelevant files were being searched.
If you're more experienced with windows, those desktop files are basically like a more detailed version of a windows shortcut file. They're installed to /usr/share/applications upon installing most linux gui apps.
Here are the contents of gimp.desktop.[Desktop Entry] Version=1.0 Type=Application Name=GNU Image Manipulation Program Name[ar]=برنامج جن +08; لمعالجة ال& +#1589;ور Name[ast]=Programa de manipulación d'Imaxe GNU Name[be]=GNU Image Manipulation Program Name[bg]=Редактор 
 +85;а изображе&# +1085;ия (GIMP) Name[ca]=Programa de retoc d'imatges de GNU Name[ca@valencia]=Programa de retoc d'imatges de GNU Name[cs]=GNU Image Manipulation Program Name[da]=GNU Image Manipulation Program Name[de]=GNU Image Manipulation Program GenericName=Image Editor GenericName[ar]=محرر صور GenericName[ast]=Editor d'imaxe GenericName[be]=Рэдактаl +8; відарысаў GenericName[bg]=Редактоl +8; на изображ&# +1077;ния GenericName[ca]=Editor d'imatges GenericName[ca@valencia]=Editor d'imatges GenericName[cs]=Editor obrázků GenericName[da]=Billedredigering GenericName[de]=Bildeditor Comment=Create images and edit photographs Comment[ar]=أنشئ صورا +وحرر لقطات Comment[ast]=Cree imáxenes y edite semeyes Comment[be]=Стварэнь&# +1085;е відарыса +ў і рэдагав
 +72;ньне фатаг&# +1088;афій Comment[bg]=Създаван&# +1077; на изображ +;ения и реда +082;ция на сним +ки Comment[ca]=Creeu imatges i editeu fotografies Comment[ca@valencia]=Creeu imatges i editeu fotografies Comment[cs]=Vytvářet obrázky a upravovat fotografie Comment[da]=Opret billeder og redigér fotografier Comment[de]=Bilder erstellen und Fotografien bearbeiten Exec=gimp-2.6 %U TryExec=gimp-2.6 Icon=gimp Terminal=false Categories=Graphics;2DGraphics;RasterGraphics;GTK;</b> X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=GIMP X-GNOME-Bugzilla-Component=General X-GNOME-Bugzilla-Version=2.6.11 X-GNOME-Bugzilla-OtherBinaries=gimp-2.6 StartupNotify=true MimeType=application/postscript;application/pdf;image/bmp;image/g3fax; +image/gif;image/x-fits;image/pcx;image/x-portable-anymap;image/x-port +able-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x- +psd;image/x-sgi;image/x-tga;image/x-xbitmap;image/x-xwindowdump;image +/x-xcf;image/x-compressed-xcf;image/tiff;image/jpeg;image/x-psp;image +/png;image/x-icon;image/x-xpixmap;image/svg+xml;image/x-wmf;
[Desktop Entry] Name=Audacity Name[de]=Audacity Name[ru]=Audacity GenericName=Sound Editor GenericName[de]=Audio-Editor GenericName[ru]=Редактоl +8; звуковых ф&# +1072;йлов Comment=Record and edit audio files Comment[de]=Audio-Dateien aufnehmen und bearbeiten Comment[ru]=Запись и р +едактирова +;ние звуков
 +99;х файлов Icon=audacity Type=Application Categories=AudioVideo;Audio;AudioVideoEditing; Exec=audacity StartupNotify=false Terminal=false MimeType=application/ogg;audio/basic;audio/mpeg;audio/x-aiff;audio/x-m +p3;audio/x-wav;application/x-audacity-project;
Submenu = "Audio" { Entry = "Ardour" { Actions = "Exec ardour3" } Entry = "Audacity" { Actions = "Exec audacity" } Entry = "Calf Plugin Pack for JACK" { Actions = "Exec calfjack +host" } Entry = "DeaDBeeF" { Actions = "Exec deadbeef" } Entry = "gtkpod iPod Manager" { Actions = "Exec gtkpod" } Entry = "JACK Rack" { Actions = "Exec jack-rack" } Entry = "JAMin" { Actions = "Exec jamin" } Entry = "Patchage" { Actions = "Exec /usr/bin/patchage" } Entry = "QjackCtl" { Actions = "Exec /usr/bin/qjackctl" } Entry = "Rakarrack" { Actions = "Exec rakarrack" } } Submenu = "Graphics" { Entry = "gbdfed" { Actions = "Exec gbdfed" } Entry = "GNU Image Manipulation Program" { Actions = "Exec gim +p-2.6" } Entry = "Inkscape" { Actions = "Exec inkscape" } Entry = "mtPaint" { Actions = "Exec mtpaint" } Entry = "Viewnior" { Actions = "Exec viewnior" } } Submenu = "Network" { Entry = "Mobloquer" { Actions = "Exec /usr/bin/mobloquer" } Entry = "Avahi SSH Server Browser" { Actions = "Exec /usr/bin/ +bssh" } Entry = "Avahi VNC Server Browser" { Actions = "Exec /usr/bin/ +bvnc" } Entry = "Firefox" { Actions = "Exec firefox" } Entry = "IcedTea Web Start" { Actions = "Exec /usr/lib/jvm/jav +a-6-openjdk/bin/javaws" } Entry = "Midori" { Actions = "Exec midori" } Entry = "Net Activity Viewer" { Actions = "Exec netactview" } Entry = "Nicotine-Plus" { Actions = "Exec nicotine.py" } Entry = "Transmission" { Actions = "Exec transmission-gtk" } } Submenu = "Settings" { Entry = "ARandR" { Actions = "Exec arandr" } Entry = "IcedTea Web Control Panel" { Actions = "Exec /usr/lib +/jvm/java-6-openjdk/bin/itweb-settings" } Entry = "Customize Look and Feel" { Actions = "Exec lxappearan +ce" } Entry = "Disk Utility" { Actions = "Exec palimpsest" } Entry = "Qt Config " { Actions = "Exec /usr/bin/qtconfig" } Entry = "TintWizard" { Actions = "Exec tintwizard" } } Submenu = "System" { Entry = "Avahi Zeroconf Browser" { Actions = "Exec /usr/bin/av +ahi-discover" } Entry = "BleachBit (Admin)" { Actions = "Exec bleachbit-admin" + } Entry = "BleachBit" { Actions = "Exec bleachbit" } Entry = "FSlint" { Actions = "Exec fslint-gui" } Entry = "GConf Cleaner" { Actions = "Exec gconf-cleaner" } Entry = "GParted" { Actions = "Exec gksu /usr/sbin/gparted" } Entry = "gtk-iptables" { Actions = "Exec /usr/bin/gksu gtkipta +bles" } Entry = "Htop" { Actions = "Exec htop" } Entry = "Task Manager" { Actions = "Exec lxtask" } Entry = "PCManFM-Mod File Manager" { Actions = "Exec pcmanfm-m +od" } Entry = "rxvt-unicode" { Actions = "Exec urxvt" } } Submenu = "Utility" { Entry = "ChmSee" { Actions = "Exec chmsee" } Entry = "Archive Manager" { Actions = "Exec file-roller" } Entry = "Figaro's Password Manager 2" { Actions = "Exec fpm2" +} Entry = "Redshift" { Actions = "Exec gtk-redshift" } Entry = "LilyTerm" { Actions = "Exec lilyterm" } Entry = "Disk Utility" { Actions = "Exec palimpsest" } Entry = "Search for Files or Folders" { Actions = "Exec pcmanf +m-mod --find-files" } Entry = "PCManFM-Mod File Manager" { Actions = "Exec pcmanfm-m +od" } }
With certain applications I had previously installed, the desktop files would occasionally contain one or more sections in addition to the [Desktop Entry] section , which would often contain another Name=xxxx and Exec=xxxx line. This is why I would like to find a way to either limit the regex match to only the first instance or else be able to specify a start/stop range for the matching.
I appreciate your willingness to help despite not having much to go by. Thanks alot.
In reply to Re^2: very new to perl; suggestions for porting this shell script to perl?
by sinusoid
in thread very new to perl; suggestions for porting this shell script to perl?
by sinusoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |