I want to create a file in /usr/share/applications/ and put a string on it.
What I have so far:
sudo touch /usr/share/applications/test.desktop
dentry="testing"
sudo echo $dentry >> /usr/share/applications/test.desktop
But this raise an error Permission Denied. What should I do to make it works?
sudois causing the error message. Copy/paste 1 line at a time to the cmdline and execute it. See where the error is. I bet it is the first line. Are you sure you're setup properly tosudocommands. That is a whole chapter in a book ;-) . good luck.echo "$dentry"will preserve whitespace, line breaks, and shell metacharactersbin the variable's value.