Search Results

Search: Posts Made By: arm
4,875
Posted By Chubler_XL
Many modern sed implementations support extended...
Many modern sed implementations support extended regular expressions (POSIX ERE) via the -E option . This is not a powerful as perl and does not support named capture groups, but should be...
4,875
Posted By Chubler_XL
Try this: #!/usr/bin/env perl use strict; ...
Try this:

#!/usr/bin/env perl
use strict;
use warnings;
while( <> ) {
if ( /^(?=.*eventtime=(\S+))(?=.*srcip=(\S+))(?=.*srcport=(\S+))
...
2,664
Posted By Neo
Hello arm! In case you forgot to read the...
Hello arm!

In case you forgot to read the forum rules (https://www.unix.com/misc.php?do=cfrules), here are two rules you are not following here:





Please follow posting rules.

Thanks...
4,732
Posted By balajesuri
Best place to start is the AWK manual: The GNU...
Best place to start is the AWK manual: The GNU Awk User’s Guide (https://www.gnu.org/software/gawk/manual/gawk.html)
Then you need lot of patience, practice, reading forums like this one and think...
4,732
Posted By RudiC
Try awk 'NF>11 {sub(/ /,"")} 1' file ...
Try
awk 'NF>11 {sub(/ /,"")} 1' file
UnitedStates 1.2.3.4 80 10 1563790914 1 1932454179 1.2.3.6 55517 11.1.2.1 55517
Italy 1.2.3.4 80 10 1563790914 1 1932454179 1.2.3.6 55517 ...
17,787
Posted By RudiC
Show your script.
Show your script.
2,642
Posted By rbatte1
Just remove the code echo " and " >> a.out and...
Just remove the code echo " and " >> a.out and your loop should process them all.

If you are concenerned by the del during testing, you could just issue a dir of the file instead.


I hope...
16,022
Posted By hanson44
Here is the input you most recently posted: $...
Here is the input you most recently posted:
$ cat input
2 9647701612350 9647701168456 262 23 1303031257462B0300 1303031259182B0300 92 9647701146402 0
5 ...
16,022
Posted By hanson44
Sure, substr is a function that returns a...
Sure, substr is a function that returns a "substring".

$3 - obviously, that's the field to work on.

0 - starting position. Properly, should have been 1, since awk numbers starting from 1 for...
16,022
Posted By MadeInGermany
Maybe simply type this in? awk '($1=="10" ||...
Maybe simply type this in?
awk '($1=="10" || $1=="20") && ($2=="10" || $2=="20") && $3>"130302" {print}' myfileOr modify it a bit like this?
awk '($1=="10" || $1=="20") && ($2=="10" || $2=="20") &&...
16,022
Posted By Yoda
I think there is some confusion. I was merely...
I think there is some confusion. I was merely trying to correct the syntax error in the original post:

If you check, OP missed a slash and there was a blank space ! ~ instead of !~.

So this...
16,022
Posted By Corona688
Try nawk instead of awk. On some systems, plain...
Try nawk instead of awk. On some systems, plain awk is very, very old.
16,022
Posted By Yoda
Ok so there is nothing wrong with backslash: ...
Ok so there is nothing wrong with backslash:
awk '$2 ~ /[12]0' myfile
syntax error The source line is 1.
The error context is
$2 ~ >>> /[12]0 <<<
And there is nothing wrong...
16,022
Posted By Yoda
First of all I didn't understand your requirement...
First of all I didn't understand your requirement clearly.

But I noticed few syntax error in your code:
awk '( $1 ~ /[12]0/ || $2 ~ /[12]0/ ) && $3 !~ /130302/ { print $0 }' myfile
871
Posted By MadeInGermany
Ensure that files are really files and more than...
Ensure that files are really files and more than 8 characters long!
Quote variables in command arguments!
for file in ?????????* ; do
[ -f "$file" ] || continue
dir=$( echo "$file" | cut...
3,783
Posted By hanson44
I edited the script some to show how to get rid...
I edited the script some to show how to get rid of the duplication.
for file in * ; do
dir=$( echo $file | cut -c1-8 )
[ -d $dir ] || mkdir -p $dir
echo "$dir was created"
[ -f $file ]...
1,826
Posted By hanson44
f01) only matches f01 f01*) matches anything...
f01) only matches f01
f01*) matches anything starting with "f01", such as "f01_201304280000.DAT"

You have to include the wildcard * character.

Also, you need to terminate the case statements...
3,783
Posted By hanson44
To help people help you, I've reformatted the...
To help people help you, I've reformatted the really long, totally unreadable, one-liner script that was the last script you posted. Could you verify this is correct current script:
#!/bin/sh
...
3,783
Posted By RudiC
See post #5. And: your post #13 is unreadable.
See post #5. And: your post #13 is unreadable.
3,783
Posted By MadeInGermany
Why are the loops nested?? The find loop...
Why are the loops nested??
The find loop obscures the outer loop by moving files away.
Also the find loop finds the already moved files.
Untested propopsal:
for file in ?????????*
do
if [ -f...
3,783
Posted By RudiC
Please use code tags as required by forum rules! ...
Please use code tags as required by forum rules!

And: post an execution log of your script running (= set the -x option)
1,476
Posted By rbatte1
The trace information will come out to standard...
The trace information will come out to standard error (file descriptor 2) rather than standard output.

You could try:-
sh -x ./my_script.sh > output.txt 2>&1
or
sh -x ./my_script.sh 2>&1 | tee...
Forum: AIX 04-11-2013
2,795
Posted By zaxxon
Use Google and get either those sold by companies...
Use Google and get either those sold by companies or download those that IBM offers. This is nor Warez-eXchange site and I bet you can use Google or any other search engine on your own ;)

-closed-
Forum: Red Hat 06-09-2012
1,712
Posted By Scrutinizer
Do you mean something like this? ...
Do you mean something like this?

http://ecx.images-amazon.com/images/I/7143pUW%2BqTL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg
Forum: AIX 08-25-2011
4,947
Posted By h@foorsa.biz
TSM is an enterprise which is capable of handling...
TSM is an enterprise which is capable of handling large chunks of data and many clients with different architectures and heterogeneous hosts .
So keep in mind that there are some limitation lay down...
Showing results 1 to 25 of 26

 
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy