Hi GNUser
First let me start out by saying I was not criticizing, judging, or
objecting to your proposed changes. Just sharing some tools
for your toolbox.
A couple of notes.
First, using echo also compresses multiple spaces between words:
tc@E310:~$ Var1=" Too many spaces "
tc@E310:~$ echo "$Var1"
Too many spaces
tc@E310:~$ echo $Var1
Too many spaces
Second, it seems I was late to the party. Roberts already incorporated
a trim function in tc-functions dating back to at least TC3:
tc@E310:~$ grep trim /etc/init.d/tc-functions
trim() { echo $1; }
tc@E310:~$ trim "$Var1"
Too many spaces
tc@E310:~$
... Rich's idea of removing leading whitespace, trailing whitespace, and blank lines before parsing the .desktop file is very tempting. ...
Actually, I wasn't suggesting that. It would mean replacing the symlinks with copies of the files.
However, it might be worth adding to submitqc.
... there is a never-ending drive to catch _ALL_ the corner/edge cases, ...
I would not call this a corner case. Excess whitespace is invisible when not bracketed by
printable characters and would go unnoticed. Most commands would ignore it and it would
not matter. When it occurs in a string being searched for, it does matter.