Hi ,
Can anybody explain how this perl one liner works..
It is to test whether the number is prime or not
perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 19
Thanks in advance
Shihab (2 Replies)
Greetings, I attempting to create a line statement that will do the following:
1. Read the input file
2. Extract lines containing certain keep words
3. Print the lines in a tabular format (CSV)
Help is what I have so far:
# cat text.tx | egrep -i -e "(Check Name) | (Risk Level) |... (6 Replies)
I want to use SED to replace all new line characters of a file, I googled and found this one liner
sed '{:q;N;s/\n//g;t q}' infile
what do :q;N; and t q mean in this script? (6 Replies)
abc/abc1/abc2/abc3/abc4
i need a script to pick this above path when ever
any patterns like the below will be found.
abc/abc1
abc/abc1/abc2
abc1/abc2/abc3
abc2/abc3/abc4
abc2/abc3/
etc ....
etc.....
not only the above 5 but like these one..
any one liner will be of great... (1 Reply)
Hi I have a log data that shows chunks of data like this:
thisis example test, this is example test, this is example test
thisis example test, this is example test, this is example test
thisis example test, this is example test, this is example test
thisis example test, this is example test,... (2 Replies)
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
I have a data base of part numbers:
AAA Thing1
BBB Thing2
CCC Thing3
File one is a list of part numbers:
AAA234
BBB678
CCC2345
Is there a sed one-line that would compare a data base with and replace the part numbers so that the output looks like this?
AAA234 Thing1
BBB678 Thing2... (5 Replies)
Hello,
I am trying to sort/get some specific output from a ls command but however I am having no luck. The command I am using is
'ls -al /nim/dr/mksysb/\*'|grep -e _dr -e .tgz|cut -c37-90|cut -d" " -f2-8|cut -d_ -f1
the error is
bash: ls -al /nim/dr/mksysb/\*: No such file or directory
... (1 Reply)