#!/bin/bash
#...
for i in `ls -c1 /usr/share/applications`
do
name="cat $i | grep ^Name= | cut -d = -f2"
echo $name
#...
done
Now inside name as output is present:
while i want only the result of the command.
Ideally i would like obtain that information using only bash ... or bash+sed or bash+awk but i don't known if is possible so, for the moment, i used bash+grep+cut.
The final project will be an automatic menu generator for pekwm and, i hope, even for icewm.
If is possible i would like obtain that information using only the language that i specify above because i don't want use big languages (i means big package as perl, python, etc).
The final stage will be a test even on openbsd.
Note:
This is the second day that i'm broken my head on the wall. :wall:
Those are not single quotes but backquotes, also called a grave accent mark. Usually to the left of the number 1 key. You can also do this which handles nesting commands better:
The `ls ...` command substitution in the for loop will mangle any filenames containing IFS characters (by default, space, tab, and newline). Perhaps that's related to your breakage.