||03-07-2013 01:55 PM
Cli command to search and print file content without printing searchword?
So here's what I'm trying to do - I want to create a script that searches the files in /usr/share/applications for terms like "Name", "Icon", "Cathegory" and "Exec" and I want the results (without the searchwords themselves) appear in a new file in this format: name icon category exec. So basically I want to create a script to automatically populate wmdrawer with contents from the .desktop files in /usr/share/applications. How can I best accomplish this without getting too complicated? I was thinking of using a combination of "grep" and "echo" commands but grep always outputs the searchwords too. Any ideas?