![]() |
killall = no process killed ?
looking for some help with this,
i have a desktop file that i need to copy a file, and then kill a process, looks like this so far: Exec=osso-xterm 'sudo cp -r /home/user/MyDocs/rtcom-messaging-ui.launch /usr/bin/' Exec=osso-xterm 'sudo killall rtcom-messaging-ui' but the second part is not doing anything also tried it in one single command like this: Exec=osso-xterm 'sudo cp -r /home/user/MyDocs/rtcom-messaging-ui.launch /usr/bin/ killall rtcom-messaging-ui' but still the killall part does nothing both commands work if i enter them seperately in xterm, but again, i need all this in a desktop file so i can run it with the click of a button, can any of you clever souls help!:confused: |
Re: killall = no process killed ?
&& is used to concatenate shell commands. Put that between the commands. You can also use ; as concatenation but then the result of the first command won't affect the second (as far as I know, look in the documentation for the busybox).
EDIT: And to understand why the second of your versions won't work, have a look at what you've actually written. You're trying to copy unwanted things to unwanted places. This might very well end up doing bad things with the system. |
Re: killall = no process killed ?
Exec=osso-xterm 'sudo cp -r /home/user/MyDocs/rtcom-messaging-ui.launch /usr/bin/ && killall rtcom-messaging-ui'
copys the file, but still not killing the process:( |
Re: killall = no process killed ?
theres method in the madness bro!
i deliberately want to do bad things to MY system! i know exactly what im copying from and to its for a good reason just need help to get it to work like it does using xterm thing is after copying 'my' file to usr/bin the old one is still running this is why i need to kill that process, for mine to be started |
Re: killall = no process killed ?
just noticed that if i have && in my command,
killall rtcom-messaging-ui no longer works in xterm either |
Re: killall = no process killed ?
still getting nowhere with this:(
|
Re: killall = no process killed ?
Code:
sudo cp -r /home/user/MyDocs/rtcom-messaging-ui.launch If I try Code:
ls && ls How do you know that the killall command hasn't been run? Did you try with a ";" too? |
Re: killall = no process killed ?
I experienced, that the combination of two commands with ';' or '&&' wasn't working within ' .desktop'-files. (at leat the way i tried)
So i putted the commands into a shell-script and executed the script via the .desktop-link... That solved the problem... at least for me ;) |
Re: killall = no process killed ?
i tried both && and ;
i know killall wasnt run because messaging still works it should fail to work and say internal error messaging closed, like it does if i use xterm running seperate commands the shell script idea looks promising, but im a total linux n00b here! im actually surprised i got this far! how do i make a shell script and execute it in a desktop file? |
Re: killall = no process killed ?
oA simple script could look like this:
Code:
#!/bin/sh Code:
#!/bin/sh Then you have to make it executable: Code:
chmod u+x /home/user/bin/$filename Then the exec-line in .desktop-file should look like this: Code:
Exec=osso-xterm -e "sudo /home/user/bin/$filename" In advance you can check if the script is working via: Code:
/home/user/bin/$filename |
All times are GMT. The time now is 14:46. |
vBulletin® Version 3.8.8