Kill process by seeing the console messages via perl script [closed] - regex

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have script which displays following messages on the console whenever a script runs in perforce. The messages are as follows:
35000 P4V/2010.1/2010.1/260003/v67 R yzhao dfasfd 00:00:04 IDLE none
45000 unnamed p4-python script/v71 10.4.16.60 R integration 06:40:38 IDLE none
Please can you suggest how to kill the 45000 process and not the 35000 process as the second process contains R integration in the line. Also, they are not getting saved in any file.
Thanks in advance.

try this :
print qx(kill -9 45000); # assuming you are signed in as yzhao

Related

Is there a way to have a C or C++ program open a new terminal window and start executing code for you? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 months ago.
Improve this question
I want to create a C or C++ program that automates some things for me.
The idea is as such: I run the program ./a.out and sit back and watch as it opens up three or four new terminal windows and runs various UNIX commands. Is there a way to do this?
I am on a MacBook.
As the comments point out, this is probably best accomplished by a shell script. However, you can execute shell commands from C with the system(3) standard library function. To open a terminal, just run a terminal with a particular command. For example:
system("xterm -e 'echo hello; sleep 5'");

Limited .exe Output in C++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm sure this is a simple question, but I tried a couple google searches and wasn't sure what keywords to search.
After executing my program in C++ the .exe window that opens is only showing the bottom part of my output, while cutting off the top. Any thoughts on how to view all of my output?
Thank you.
You can redirect the output of the program to a file:
your-program.exe > file.txt
Alternatively, you can pipe the output into more:
your-program.exe | more
This will pause the output of your program when it fills one screen until you press the space bar.
Both approaches have their pros and cons: if you redirect the output to file and open that file while the program is running, you might not see the last chunk of data, because the OS might buffer the data before writing it to hard disk.
If you pipe the output into more then the execution of your program might be suspended while more is waiting for your input.
[Edit: incorporated enhzflep's suggestion of using a redirection to a file.]
suppose you have an "a.exe" program
execute the program like this:
a.exe >1.txt
and open the file "1.txt" with notepad or other editor(such as notepad++).

Why my DOS interface will flash across when I run a cpp file in Sublime Text 3? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Just as you see in the title? I have been confused about that for a long while.
In many windowing systems, a console window is opened up when your program starts executing. When your program stops executing the window disappears. This regardless to any output sent to the console.
If your program is quick, the console will "flash" by.
If you want your console window to stay for a while, you will need to pause execution. My idiom is:
std::cout << "\nPaused. Press Enter to continue.\n";
std::cin.ignore(10000, '\n');
I don't use system("Pause") because not all operating systems have a Pause command.

Coldfusion scheduler event Handler cannot be found [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Trying to add an Event handler to a scheduled task in ColdFusion11.
I'm supposed to write a component that implements CFIDE.scheduler.ITaskEventHandler and "Specify a dot-delimited CFC path under webroot, for example a.b.server (without the CFC extension)"
I tried to put my component under
ColdFusion11/cfusion/wwwroot
ColdFusion11/cfusion/wwwroot/CFIDE
ColdFusion11/cfusion/wwwroot/CFIDE/scheduler
the Apache webroot
some virtual host webroot
I tried to add some dot notation (?) like CFIDE.scheduler.myEventHandler...
I don't understand if there is some more configuration at server level to understand.
I don't see any error in logs, the scheduler editor just refuse to save an EventHandler he cannot find, with the error
An error occured scheduling the task.
Invalid eventhandler.
Error: Eventhandler myEventHandler could not be found
Any help appreciated
The correct way seems to put the component in ColdFusion11/cfusion/wwwroot/myEventHandler.cfc, set the path as myEventHandler and implement in the component "CFIDE.scheduler.ITaskEventHandler"

Putty - Can't See Top of Error Stack Trace [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am coding on Putty (in C++ for what it's worth) and I am currently encountering an error that gives me a really long stack trace. Apparently, the trace is so long that Putty won't let me scroll to the very top where it originated (where I typed "make"). Is there any way around this (except by obviously fixing the error)?
There are two ways.
Change the Window buffer size. Open Putty, load the connection (don't double-click or hit open), click on Window on the left panel and increase the Lines of scrollback to something like 3000 (I think the default is 200).
Same way, load the connection, and then on the left panel under Session you will have the sub-category logging where you can set a file where the entire session history will be recorded.
To increase the lines of scrollback, before you make a putty connection, click on the category Window and increase the lines of scrollback to 10000 or 20000 as may suit you.