02-08-2011
Quote:
Originally Posted by
Corona688
Right tool for the right job and all that. You want to match a line and extract the third token? Well awk matches lines, and extracts tokens. You'd need to write a big monster of an expression to tell sed what you mean by 'token'.
But we can map any sequence of characters with '.*' right in Sed? Where I am going wrong in my code?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Everyone.-
Coul you tell me how to obtain the "Resident memory size" for any program runs on Dec TRU64 machine.
What is the command in order to obtaing this value??
Best Regards
Cristobal (1 Reply)
Discussion started by: Cristobal Perez
1 Replies
2. Debian
Hi All,
I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel).
For my application:
<sar -U ALL>
CPU %user %nice %system %idle
...
10:58:04 0 153.10 0.00 38.76 0.00
10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
Discussion started by: jaduks
0 Replies
3. Fedora
I would like to pipe "top -n" to a text file, but I get an error:
top: cannot open /dev/kmem
kvm_open: Permission denied
I am a non-root user.
If I could find a way to get this type of output:
"Memory: 2048M real, 1516M free, 4099M swap free"
into a text file, I could further automate... (13 Replies)
Discussion started by: safraser
13 Replies
4. UNIX for Dummies Questions & Answers
Hi!!..
I would like to know what is maximum character size for a command in the "sh" or "bourne" shell?
Thanks in advance..
Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies
5. UNIX for Advanced & Expert Users
Hi!!..
I would like to know what is maximum character size for a command in the "sh" or "bourne" shell?
Thanks in advance..
Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies
6. Shell Programming and Scripting
Hi!!..
I would like to know what is maximum character size for a command in the "sh" or "bourne" shell?
Thanks in advance..
Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies
7. UNIX for Dummies Questions & Answers
When I do a listing in one particular directory (ls -al) I get:
total 43456
drwxrwxrwx 2 root root 4096
drwxrwxrwx 3 root root 4096
-rwxrwxr-x 1 nobody nobody 3701594
-rwxrwxr-x 1 nobody nobody 3108510
-rwxrwxr-x 1 nobody nobody 3070580
-rwxrwxr-x 1 nobody nobody 3099733
-rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies
8. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
9. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
10. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT DEBIAN
path::dispatcher::rule::tokens
Path::Dispatcher::Rule::Tokens(3pm) User Contributed Perl Documentation Path::Dispatcher::Rule::Tokens(3pm)
NAME
Path::Dispatcher::Rule::Tokens - predicate is a list of tokens
SYNOPSIS
my $rule = Path::Dispatcher::Rule::Tokens->new(
tokens => [ "comment", "show", qr/^d+$/ ],
delimiter => '/',
block => sub { display_comment(shift->pos(3)) },
);
$rule->match("/comment/show/25");
DESCRIPTION
Rules of this class use a list of tokens to match the path.
ATTRIBUTES
tokens
Each token can be a literal string, a regular expression, or a list of either (which are taken to mean alternations). For example, the
tokens:
[ 'ticket', [ 'show', 'display' ], [ qr/^d+$/, qr/^#w{3}/ ] ]
first matches "ticket". Then, the next token must be "show" or "display". The final token must be a number or a pound sign followed by
three word characters.
The results are the tokens in the original string, as they were matched. If you have three tokens, then "match->pos(1)" will be the
string's first token ("ticket"), "match->pos(2)" its second ("display"), and "match->pos(3)" its third ("#AAA").
Capture groups inside a regex token are completely ignored.
delimiter
A string that is used to tokenize the path. The delimiter must be a string because prefix matches use "join" on unmatched tokens to return
the leftover path. In the future this may be extended to support having a regex delimiter.
The default is a space, but if you're matching URLs you probably want to change this to a slash.
case_sensitive
Decide whether the rule matching is case sensitive. Default is 1, case sensitive matching.
perl v5.12.4 2011-08-30 Path::Dispatcher::Rule::Tokens(3pm)