开发者

How do I launch an application from a .sh script?

开发者 https://www.devze.com 2023-02-05 08:13 出处:网络
Help me please with a bash script of a few lines. I have a MyApplication executable in some folder, and I need to make a launcher script to call that application from it\'s folder when I click it fro

Help me please with a bash script of a few lines.

I have a MyApplication executable in some folder, and I need to make a launcher script to call that application from it's folder when I click it from a grafical interface.

(I need this because I need my application to be launched from it's folder, so that Qt::currentPath() will return the current 开发者_运维知识库folder the executable is in)

Please help me, I just had to power off my linux machine two times in a row, I made fork bombs instead of launchers :(.

P.S. I'm a linux newbie, trying to figure out scripting.

EDIT

More about my current problem: Qt how to open a file in current dir ? or what's wrong with this?

Details: MyApplication is a GUI project compiled in Qt-Creator. It uses .xml files for storage. If I cd manually to the folder the executable is in, and run it, everything works fine, the application knows the path to the .xml files (current directory). But, if I just click the icon of the application it launches from $HOME, and my application is not able to find those .xml files.

That's why, I suppose, I need a .sh launcher, to call it from it's directory when I'll click it.


If its a graphical application, any sort of link will do. That works fine for me, unless you have something I'm not aware of, in which case please explain more.

Ps, fork bombs are limitable - http://forums.debian.net/viewtopic.php?f=10&t=44480&start=0

0

精彩评论

暂无评论...
验证码 换一张
取 消