Add Timer & kill
Implemented time and kill, due to name conflict on windows i named it timer
timer(same as time on unix to time how load a proves takes eg.timer curl http://google.com
C:\tmp>timer curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
Time: 1.223s
kill- simple way to kill system process based ontaskkill(I can send a pull request on this if you want) eg.
kill firefox
kill notepad chrome taskmgr
Hi Oleku, thanks very much for your efforts
- Good news: the time/timer util is good stuff (just needs some tweaking to make it cross-platform).
- Bad news: sorry but the kill util is not applicable for 3 reasons: 1) it's not cross-platform (Windows only), 2) it doesn't behave like the linux 'kill' command - it's more like 'killall', and 3) I don't want to go down the road of wrapping existing commands - not just yet anyway. It's not where I'm going with this project. If you have the stomach to make it cross-platform (Linux/Win/Mac at least), then it's certainly a worthwhile tool, but otherwise it's best to keep it separate for now.
So, if you were open to submitting a separate pull request with just the time command, and without the 'cmd /c' part, then we'd be in business (with some caveats: I'll still call it 'time' for consistency - Windows users would need to call 'some time', and I'll change the import paths to my repo). Sorry but I need to keep things consistent.
All good? Cheers
Good news: the time/timer util is good stuff (just needs some tweaking to make it cross-platform).
I would see what i can do ... just be travail making it cross platform
it's not cross-platform (Windows only)
We can achieve the same function with pgrep + syscall.Kill on posix platforms
it doesn't behave like the linux 'kill' command - it's more like 'killall',
you are right if multiple process has the same name it would kill all the process
don't want to go down the road of wrapping existing commands - not just yet anyway. It's not where I'm going with this project.
Noted
without the
cmd /c
There is no other way that i know off that works on windows
Maybe 'wrapped' commands should belong inside 'otherutils' - I guess there
won't be any other way to do a 'kill' on Windows for the moment.
For info, 'kill' in unix takes a process id. So, you'd use 'ps' or similar
to find the process id, and then subsequently kill
On Tue, Mar 4, 2014 at 9:52 PM, Oleku Konko [email protected]:
Good news: the time/timer util is good stuff (just needs some tweaking to make it cross-platform).
I would see what i can do ... just be travail making it cross platform
it's not cross-platform (Windows only)
We can achieve the same function with pgrep + syscall.Kill on posix platforms
it doesn't behave like the linux 'kill' command - it's more like 'killall',
you are right if multiple process has the same name it would kill all the process
don't want to go down the road of wrapping existing commands - not just yet anyway. It's not where I'm going with this project.
Noted
Reply to this email directly or view it on GitHubhttps://github.com/laher/someutils/pull/2#issuecomment-36603525 .