grep "KeyNotFoundException" weblogic.log
After running this command the output is
abcxyzexceptions.KeyNotFoundException: Person not found
How to know ..what is the line number of the above string in the log file. (2 Replies)
i want to cut all the entries from the /etc/passwd file in which the uid is> 500
for this i was writing this ,m quiet new to all this.. scripting
but on the 6th n 8th line ,, i hav to specify a line number .. to get the commnd working .. but i want to use variable i instead of that ,,... (2 Replies)
Dear community,
I'm quite a newbie with scripting, I have this problem:
I have a file with many lines and I want to copy the lines from 1 to N to file.1, from N+1 to 2N to file.2, and so on up to the end of the file
I have tried with something like this (N=43 in this example):
awk '{for... (2 Replies)
Hello all
i know it is pretty hard one but you will manage it all
after noticing and calculating i find a rhythm for the file i want to edit
to copy the last 12 characters in line but the problem is to add after first 25 characters in same line
in other way too copy the last 12 characters... (10 Replies)
Hi All,
I need to copy a specific line from a file to another file.
lets suppose the line number 13 of a file
when I am writing the line number explicitly.. its working fine
sed -n '13p' afile > anotherfile
but, when inside a script, i am getting the line number value inside a variable... (4 Replies)
hi all,
i am newbie to Unix scripting..
I am writing a script which will have a line of commands, which needs to be copied to clipboard.
Any ideas welcome..
Usage::
I am using the script in this way, The script will have some lines (like below)
export TERM=xterm; cd test_env; TMOUT=0
... (1 Reply)
Hi,
I have a file as such
1 <text1><text2></
2 <text3><text4></
3 <text5><text6></
4 <text7><text8></
I need is so the first bit of text in the line is at the end as its xml so
1 <text1><text2></text1>
2 <text3><text4></text3>
3 <text5><text6></text5>
4 ... (12 Replies)
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Trace(3pm) User Contributed Perl Documentation Trace(3pm)NAME
Devel::Trace - Print out each line before it is executed (like "sh -x")
SYNOPSIS
perl -d:Trace program
DESCRIPTION
If you run your program with "perl -d:Trace program", this module will print a message to standard error just before each line is executed.
For example, if your program looks like this:
#!/usr/bin/perl
print "Statement 1 at line 4
";
print "Statement 2 at line 5
";
print "Call to sub x returns ", &x(), " at line 6.
";
exit 0;
sub x {
print "In sub x at line 12.
";
return 13;
}
Then the "Trace" output will look like this:
>> ./test:4: print "Statement 1 at line 4
";
>> ./test:5: print "Statement 2 at line 5
";
>> ./test:6: print "Call to sub x returns ", &x(), " at line 6.
";
>> ./test:12: print "In sub x at line 12.
";
>> ./test:13: return 13;
>> ./test:8: exit 0;
This is something like the shell's "-x" option.
DETAILS
Inside your program, you can enable and disable tracing by doing
$Devel::Trace::TRACE = 1; # Enable
$Devel::Trace::TRACE = 0; # Disable
or
Devel::Trace::trace('on'); # Enable
Devel::Trace::trace('off'); # Disable
"Devel::Trace" exports the "trace" function if you ask it to:
import Devel::Trace 'trace';
Then if you want you just say
trace 'on'; # Enable
trace 'off'; # Disable
TODO
o You should be able to send the trace output to the filehandle of your choice.
o You should be able to specify the format of the output.
o You should be able to get the output into a string.
We'll see.
LICENSE
Devel::Trace 0.11 and its source code are hereby placed in the public domain.
Author
Mark-Jason Dominus (C<mjd-perl-trace@plover.com>), Plover Systems co. See the C<Devel::Trace.pm> Page at
http://www.plover.com/~mjd/perl/Trace for news and upgrades.
perl v5.14.2 2012-02-16 Trace(3pm)