Sponsored Content
Full Discussion: Capturing key strokes
Top Forums Shell Programming and Scripting Capturing key strokes Post 302263294 by Perderabo on Monday 1st of December 2008 08:54:10 AM
Old 12-01-2008
You can capture any character, including control Z. However you can't capture other keys like "shift". If a user simply taps the "shift" key, say, 3 times. nothing is sent to the system. For an example of capturing characters, see: https://www.unix.com/shell-programmin...character.html
 

8 More Discussions You Might Find Interesting

1. Programming

Keyboard Strokes w/o Delay...

Hello(again), but I was wondering how you would obtain a keyboard stroke from a user with no delay(they don't have to hit enter) and then place that stroke into a variable? Lets say you tell the user to hit, on the numpad, a number. Then that number is placed into a variable w/o the user hitting... (2 Replies)
Discussion started by: mbolthouse
2 Replies

2. Shell Programming and Scripting

Capturing value into variable

Hi, I am new to shell scripting, I am trying to write a shell script, which will automate the process of mailing the invoices at the end of the day. For major part I am using Oracle database function. The problem is I want to capture the value returned by the Oracle function into the script... (2 Replies)
Discussion started by: prasad01
2 Replies

3. Cybersecurity

SSH key code versus server key code

Hi, When logging in using SSH access (to a remotely hosted account), I received a prompt to accept a server's key fingerprint. Wrote that string of code down for comparision. Already emailed my host for their listing of the string of code for the server's key fingerprint (for comparison,... (1 Reply)
Discussion started by: Texan
1 Replies

4. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

5. UNIX for Dummies Questions & Answers

Capturing a value in to variable.

Hi, I currently have a shell script where it captures in the value in to 'TOTAL' and outputs to a file, i want to capture another value of a query in to another variable and output it. Current script: sqlplus -s $user <<EOD | read TOTAL set heading off set pages 0 set feedback off set... (1 Reply)
Discussion started by: ravi0435
1 Replies

6. Shell Programming and Scripting

Capturing Particular Data

Hi everyone! Can any one help me out regarding capturing relevant data from a file. For e.g, if i want to capture the comment written after "Prompt:" for a particular date, like for this case what would be the command to capture the tag written after "Prompt:" for Date: 2009-03-20. A... (7 Replies)
Discussion started by: muhmsida
7 Replies

7. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

8. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
Perl::Critic::Policy::RegularExpressions::ProhibitUnusedUseruContributed Perl Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture(3pm)

NAME
Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture - Only use a capturing group if you plan to use the captured value. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Perl regular expressions have multiple types of grouping syntax. The basic parentheses (e.g. "m/(foo)/") captures into the magic variable $1. Non-capturing groups (e.g. "m/(?:foo)/" are useful because they have better runtime performance and do not copy strings to the magic global capture variables. It's also easier on the maintenance programmer if you consistently use capturing vs. non-capturing groups, because that programmer can tell more easily which regexps can be refactored without breaking surrounding code which may use the captured values. CONFIGURATION
This Policy is not configurable except for the standard options. CAVEATS
"qr//" interpolation This policy can be confused by interpolation of "qr//" elements, but those are always false negatives. For example: my $foo_re = qr/(foo)/; my ($foo) = m/$foo_re (bar)/x; A human can tell that this should be a violation because there are two captures but only the first capture is used, not the second. The policy only notices that there is one capture in the regexp and remains happy. "@-", "@+", $LAST_MATCH_START and $LAST_MATCH_END This policy will only recognize capture groups referred to by these variables if the use is subscripted by a literal integer. $^N and $LAST_SUBMATCH_RESULT This policy will not recognize capture groups referred to only by these variables, because there is in general no way by static analysis to determine which capture group is referred to. For example, m/ (?: (A[[:alpha:]]+) | (Nd+) ) (?{$foo=$^N}) /smx makes use of the first capture group if it matches, or the second capture group if the first does not match but the second does. CREDITS
Initial development of this policy was supported by a grant from the Perl Foundation. AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2007-2011 Chris Dolan. Many rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module perl v5.14.2 2012-06-07Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture(3pm)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy