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.launchIf I try Code:
ls && lsHow 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/shCode:
#!/bin/shThen you have to make it executable: Code:
chmod u+x /home/user/bin/$filenameThen 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 |
Re: killall = no process killed ?
chmod u+x /home/user/bin/smsmodscript
gives me: no such file or directory? tried removing .txt from the file and from the command my txt file is called smsmodscript.txt i dont have a /home/user/bin/ folder only have a /usr/bin folder using WinSCP http://img443.imageshack.us/img443/355/82578614.png |
Re: killall = no process killed ?
It doesn't matter where you save the file, but I don't like saving it to /usr/bin because it's a system folder (and would get lost with a reflash ;) ).
You can save it to /home/user also, or you create /home/user/bin with: Code:
mkdir /home/user/bin'chmod u+x smsmodscript' or, if you're in an other directory: 'chmod u+x /your/path/to/smsmodscript' where 'smsmodscript' is the filename you've choosen for the script and which it was saved to... |
Re: killall = no process killed ?
ive put the file smsmodscript.txt into home/user
and typed chmod u+x smsmodscript and chmod u+x /home/user/smsmodscript but still get no such file or directory |
Re: killall = no process killed ?
you have to use the correct filename...
Either you rename the file to 'smsmodscript' (without .txt) or you have to add the .txt to chmod-command I'd prefer renaming, because .txt is misleading ;) |
Re: killall = no process killed (solved!)
id just figured that out bro, when it started working!
awesome info all that, i knew it was going to work when i started reading it, as always it was just a case of my brain understanding it! anyway, what i did was make 2 buttons, one to crash the messaging app, and one to make it work again, kind of a a lock and unlock feature: http://img441.imageshack.us/img441/2...0062722270.png |
Re: killall = no process killed ?
Hey... I'm glad if i could help you...
Now go on and script the hell out of your pocket-plaything :P |
Re: killall = no process killed ?
yeah man, both you and Joorin helped me understand a lot in this thread, but your info got my little mod working!
now my woman cant look at my texts when im not around! happy days! |
Re: killall = no process killed ?
Quote:
|
| All times are GMT. The time now is 11:09. |
vBulletin® Version 3.8.8