guys,
my requirment goes like this:
I have a file, and wish to filter out records where
1. The first letter is o or O
and
2. The next 4 following letter should not be ther
I do not wish to use pipe and wish to do it in one shot.
The best expression I came up with is:
grep ^*... (10 Replies)
When i do ls -ld RT_BP* i am getting the following list.
drwxrwx--- 2 user group 256 Oct 17 10:09 RT_BP809
drwxrwx--- 2user group 256 Oct 17 10:09 RT_BP809.O
drwxrwx--- 2 user group 256 Oct 17 10:09 RT_BP810
drwxrwx--- 2user group 256 Oct... (2 Replies)
Hi, guys. I have one question, hope somebody can give me a hand
I have a file called passwd, the contents of it arebelow:
***********************
...
goldsimj:x:5008:200:
goldsij2:x:5009:200:
whitej:x:5010:201:
brownj:x:5011:202:
goldsij3:x:5012:204:
greyp:x:5013:203:
...... (6 Replies)
Hi,
I am executing a svnlook command to check to see if the following line exists. I need a regular expression to represent the line.
A /test/test1/qa/test2/index.html
A /test/test1/qa/test3/test.jpg
A /test/test1/qa/test3/test1.jpg
A /test/test1/qa/test4/test.swf
I just need to extract... (9 Replies)
Hello,
How to print the field separator in awk? please see the following code:
cat a.txt
a 1s 2s 3s 4s
b 2s 4s
$ awk 'BEGIN{FS==" "} {print $2 $3 }' te
1s2s
2s4s
I want to get the following output :
1s 2s
2s 4s
How to realize this ?
$ cat te
a 1s,,2s 3s ... (11 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Hi ,
I have few lines like
A20120101.ANU.ZIP
A20120401.ABC.ZIP
A20120105.KJK.ZIP
A20120809.JUG.ZIP
A20120101.MAT.ZIP
B20120301.ANU.XIP
I want to filter by
1. Files starting with A and Ending With Z ( ^A.*.ZIP$)
2. And either ANU, or KJK or MAT in the file name.
Hope my... (6 Replies)
Hello,
one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match
an example line is below
/logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
I want to track only below:
I am using below, but it doesn't work: (6 Replies)
Discussion started by: proactiveaditya
6 Replies
LEARN ABOUT DEBIAN
numrandom
NUMRANDOM(1) User Contributed Perl Documentation NUMRANDOM(1)NAME
numrandom - Print out a random number.
SYNOPSIS
numrandom [-dhV] /[expression]/
DESCRIPTION
numrandom will print out a random number determined by the expression that you give. The syntax and program is nearly identical to the
numrange program, except that numrandom picks a number at random from the range expression. If no expression is specified, numrandom will
print out a random integer between 1 and 100. Ranges are inclusive.
OPTIONS -h Help: You're looking at it.
-V Increase verbosity.
-d Debug mode. For developers
EXAMPLES
Random number from 1 to 10.
$ numrandom /1..10/
7
From 1 to 10 or from 15 to 20.
$ numrandom /1..10,15..20/
16
An even number from 0 to 10
$ numrandom /0..10i2/
4
An odd number. Notice the starting number in the range.
$ numrandom /1..10i2/
9
A factor of 3 between 99 and 120.
$ numrandom /99..120i3/
111
A decimal number.
$ numrandom /1.1..2.5i0.1/
1.8
A negative random number.
$ numrandom /0.0..-2.0i0.3/
-0.8
BUGS
numrandom is slow when dealing with large ranges to randomly find a number from. This is because it creates a list of all potential
numbers before picking one. So it can be memory intensive for large ranges.
SEE ALSO numaverage(1), numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrange(1), numround(1)COPYRIGHT
numrandom is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. Please read the
COPYING and LICENSE files that came with the num-utils package
Developers can read the GOALS file and contact me about providing
submitions or help for the project.
MORE INFO
More info on numrandom can be found at:
http://suso.suso.org/programs/num-utils/
perl v5.10.1 2009-10-31 NUMRANDOM(1)