03-24-2014
Quote:
Originally Posted by
joeyg
Research regular expressions.
The following are some of the special groups that can be specified:
[:alnum:] - Alphanumeric characters.
[:alpha:] - Alphabetic characters
[:blank:] - Blank characters: space and tab.
[:digit:] - Digits: '0 1 2 3 4 5 6 7 8 9'.
[:lower:] - Lower-case letters: 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.
[:space:] - Space characters: tab, newline, vertical tab, form feed, carriage return, and space.
[:upper:] - Upper-case letters: 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.
Hmm, so [: punct:] would be a good place to start with?
Last edited by fozilla; 03-24-2014 at 10:22 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In perl I want to do remove the top line of my input file then process the next line. I want to do something like
head -1 inputfile > temp
grep -v temp inputfile > newinputfile
cp newinputfile inputfle
is this possible in perl? (3 Replies)
Discussion started by: reggiej
3 Replies
2. Shell Programming and Scripting
how can i redirect standard input? i dont remember :/, though could you redirec not from a command? i mean, to redirect always stdin and stout (1 Reply)
Discussion started by: Jariya
1 Replies
3. Shell Programming and Scripting
I tried copy the output files from find command into a directory.
Example,
find / -name core 2>/dev/null | xargs cp????
I have known that we can use xargs to execute command lines from standard input but how to use it in this case.
Or I can do something besides xargs. (2 Replies)
Discussion started by: lalelle
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
How can I removed the directory in the input file?
The script responsible for storing the report in an input file is this:
while }" ]
do
echo "penetration|${penfilename}|${penfilenamedaterange}" >> ${OUT_DIR}/penrpt_emailfile.txt
(( i=i+1 ))
done
For the penfilename:
... (2 Replies)
Discussion started by: chrysSty
2 Replies
5. Shell Programming and Scripting
Hi
I am trying to write a shell script which should take the file as standard input. As file(content and name both) will change for each run. It should read the file line by line. with each line I have to perform certain operation.
For example
I have i file foo, it looks like
/usr/doc/abc... (4 Replies)
Discussion started by: shashiprakash81
4 Replies
6. Solaris
Please give me any example for standard input in Solaris. (6 Replies)
Discussion started by: karman0931
6 Replies
7. Shell Programming and Scripting
Hello,
I am new to scripting.
How do I read multiple lines from the command line?
I know read reads one line, but if I have to read multiple lines, how should I do?
Thanks,
Prasanna (4 Replies)
Discussion started by: prasanna1157
4 Replies
8. Shell Programming and Scripting
So, I am new to shell scripting and have a few problems.
I know how to read from standard input but I do not know how to really compare it to say, a character. I am trying to compare it to a character and anything exceeding just a character, the user will get an output message, but the program... (7 Replies)
Discussion started by: Bungkai
7 Replies
9. UNIX for Dummies Questions & Answers
Hi Geeks,
I am relatively new to Unix. Trying out to achive a shell script by hard learning. Here is my requirment.
1. I have to search for specified strings that are given in .csv file in the directory to find the files for matching strings in the .csv file.
2. If match is found, copy... (1 Reply)
Discussion started by: uunniixxuusseer
1 Replies
10. Shell Programming and Scripting
I want to use a content of a file as standard input to a program and dump the output to a file. However, when I try the following code:
./program < input.in > output.out
The output.out is empty. So, how can I handle this problem?
Thanks in advance! (11 Replies)
Discussion started by: Ray Sun
11 Replies
LEARN ABOUT MOJAVE
receive
term::receive(n) Terminal control term::receive(n)
__________________________________________________________________________________________________________________________________________________
NAME
term::receive - General input from terminals
SYNOPSIS
package require Tcl 8.4
package require term::receive ?0.1?
::term::receive::getch ?chan?
::term::receive::listen cmd ?chan?
cmd process string
cmd eof
::term::receive::unlisten ?chan?
_________________________________________________________________
DESCRIPTION
This package provides the most primitive commands for receiving characters to a terminal. They are in essence convenient wrappers around
the builtin commands read and fileevent.
::term::receive::getch ?chan?
This command reads a single character from the channel with handle chan and returns it as the result of the command.
If not specified chan defaults to stdin.
It is the responsibility of the caller to make sure that the channel can provide single characters. On unix this can be done, for
example, by using the command of package term::ansi::ctrl::unix.
::term::receive::listen cmd ?chan?
This command sets up a filevent listener for the channel with handle chan and invokes the command prefix cmd whenever characters
have been received, or EOF was reached.
If not specified chan defaults to stdin.
The signature of the command prefix is
cmd process string
This method is invoked when characters were received, and string holds them for processing.
cmd eof
This method is invoked when EOF was reached on the channel we listen on. It will be the last call to be received by the
callback.
::term::receive::unlisten ?chan?
This command disables the filevent listener for the channel with handle chan.
If not specified chan defaults to stdin.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
KEYWORDS
character input, control, get character, listener, receiver, terminal
CATEGORY
Terminal control
COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
term 0.1 term::receive(n)