Q:

Desktop shortcut doesn't work if use pipe in command

Today I tried to create a desktop shortcut to launch Skype and use pipelogin.
I created the following shortcut:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Skype2
Name[en_US]=Skype2
Icon=skype
Exec=echo login password | skype --dbpath=/home/kont/.Skype2 --pipelogin

but when I tried to launch it nothing happend. Then I tried to launch Skype without the pipelogin:
Exec=echo skype --dbpath=/home/kont/.Skype2

and it worked fine. So I decided that the reason is in using pipe |. To approve this version I have created the login_skype.sh file with the following code:
Exec=echo login password | skype --dbpath=/home/kont/.Skype2 --pipelogin

and changed the shortcut so that it launch the login_skype.sh and it also works fine.
Are there any ideas what was wrong in the first shortcut code version?

A:

Try launching it in a subshell:
Exec=sh -c 'echo login password | skype --dbpath=/home/kont/.Skype2 --pipelogin'

