05-18-2017
You cannot possibly have been running the code he gave you.
Show exactly what you did please, word for word, letter for letter, keystroke for keystroke.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i am very new to UNIX, i am trying to loop thru the files in a directory.
I got the filenames into a variable using
$files=`ls`
Here $files will contain
<filename1> <filename2> <filename3>
I want to get one filename at a time and append it to some some text.
forexample, ... (1 Reply)
Discussion started by: silas.john
1 Replies
2. Shell Programming and Scripting
hi all,
I have a requirement where in i have to read all the filenames based on a pattern from a directory and concatenate all these file names and write it to another file.
i am using the following code to do this
var1=''
for filename in $_DIR/${FILE_NAME}*
do
if
if
then... (7 Replies)
Discussion started by: nvuradi
7 Replies
3. Shell Programming and Scripting
I have a directory of files and each file has a random 5 digit string at the beginning that needs to be removed. Plus, there are some files that will be identically named after the 5 digit string is removed and I want those eliminated or moved.
any ideas? (17 Replies)
Discussion started by: crumb
17 Replies
4. Shell Programming and Scripting
Hi Unix experts;
I have 30000 files in a directory and am willing to do the following changes on each of them. The input files look like the following:
1 , 2
3 , 4
5 , 6
7 , 8
9 , 10
the output will have # in top 10 lines, insert space instead of comma. This looks like:
... (4 Replies)
Discussion started by: nxp
4 Replies
5. Shell Programming and Scripting
I have many files similar to this one: AC41_AC85_86_AC128_129_MC171_173_SF_207_FMV.pdf.
I want a directory named AC41 and to put the file AC41_AC85_86_AC128_129_MC171_173_SF_207_FMV.pdf into the directory. Next, a directory named AC85 and put the file into it. Also, continue to cycle through... (1 Reply)
Discussion started by: ndnkyd
1 Replies
6. UNIX for Dummies Questions & Answers
Hi I have abc_ahb_one.v
abc_ahb_two.v
abc_ahb_three.v
........l
like this
-----upto
abc_ahb_ninety.v in some directory.
I need to change those file names to like below.
... (5 Replies)
Discussion started by: praneethk
5 Replies
7. Shell Programming and Scripting
Hello,
I was given a (I suppose) a simple task which I don't know how to do. Before coming here I have read a dozen of awk tutorials (full read, not just line-skipping) but I still don't know how to do this.
Task:
Write an script file 'check.awk' with a parameter current directory that... (5 Replies)
Discussion started by: c0dehunter
5 Replies
8. Shell Programming and Scripting
Can someone give me a tip on writing a script that, for each file in the working directory, prints the filename, the # of lines, and the # of words to stdout? (2 Replies)
Discussion started by: flash123
2 Replies
9. Shell Programming and Scripting
there are mutiple file nams in the directory. How to return the the lastest files for each file name.
ex.
abc1234_050201
abc1234_050206
abc1234_050208
xyz34_050204
xyz34_050210
xyz34_050218
thanks (4 Replies)
Discussion started by: grand_sam
4 Replies
10. UNIX for Beginners Questions & Answers
Hi all, (5 Replies)
Discussion started by: KMusunuru
5 Replies
LEARN ABOUT DEBIAN
poe::wheel::curses
POE::Wheel::Curses(3pm) User Contributed Perl Documentation POE::Wheel::Curses(3pm)
NAME
POE::Wheel::Curses - non-blocking input for Curses
SYNOPSIS
use Curses;
use POE qw(Wheel::Curses);
POE::Session->create(
inline_states => {
_start => sub {
$_[HEAP]{console} = POE::Wheel::Curses->new(
InputEvent => 'got_keystroke',
);
},
got_keystroke => sub {
my $keystroke = $_[ARG0];
# Make control and extended keystrokes printable.
if ($keystroke lt ' ') {
$keystroke = '<' . uc(unctrl($keystroke)) . '>';
}
elsif ($keystroke =~ /^d{2,}$/) {
$keystroke = '<' . uc(keyname($keystroke)) . '>';
}
# Just display it.
addstr($keystroke);
noutrefresh();
doupdate;
# Gotta exit somehow.
delete $_[HEAP]{console} if $keystroke eq "<^C>";
},
}
);
POE::Kernel->run();
exit;
DESCRIPTION
POE::Wheel::Curses implements non-blocking input for Curses programs.
POE::Wheel::Curses will emit an "InputEvent" of your choosing whenever an input event is registered on a recognized input device (keyboard
and sometimes mouse, depending on the curses library). Meanwhile, applications can be doing other things like monitoring network
connections or child processes, or managing timers and stuff.
PUBLIC METHODS
POE::Wheel::Curses is rather simple.
new
new() creates a new POE::Wheel::Curses object. During construction, the wheel registers an input watcher for STDIN (via select_read()) and
registers an internal handler to preprocess keystrokes.
new() accepts only one parameter "InputEvent". "InputEvent" contains the name of the event that the wheel will emit whenever there is
input on the console or terminal. As with all wheels, the event will be sent to the session that was active when the wheel was
constructed.
It should be noted that an application may only have one active POE::Wheel::Curses object.
EVENTS AND PARAMETERS
These are the events sent by POE::Wheel::Curses.
InputEvent
"InputEvent" defines the event that will be emitted when POE::Wheel::Curses detects and reads console input. This event includes two
parameters:
$_[ARG0] contains the raw keystroke as received by Curses::getch(). An application may process the keystroke using Curses::unctrl() and
Curses::keyname() on the keystroke.
$_[ARG1] contains the POE::Wheel::Curses object's ID.
Mouse events aren't portable. As of October 2009, it's up to the application to decide whether to call mousemask().
SEE ALSO
Curses documents what can be done with Curses. Also see the man page for whichever version of libcurses happens to be installed (curses,
ncurses, etc.).
POE::Wheel describes wheels in general.
The SEE ALSO section in POE contains a table of contents covering the entire POE distribution.
BUGS
None known, although curses implementations vary widely.
AUTHORS & COPYRIGHTS
Please see POE for more information about authors and contributors.
perl v5.14.2 2012-05-15 POE::Wheel::Curses(3pm)