Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: rdcwayx
Forum: Solaris 08-31-2013
3,207
Posted By Peasant
Well for patching, first thing you learn is...
Well for patching, first thing you learn is backup then you learn repositories (IPS).
Having local repositories is a major advantage.

In Solaris 11, if you do major patching the pkg will patch...
3,214
Posted By parthmittal2007
hi rdcwayx: your code does not work in this...
hi rdcwayx:

your code does not work in this case:

Man_ID|Man_Dt|Ship_Id|Ship_Dt|ItemID|Noof ITEMS|ItemNam
001|2010-12-31|11|2010-12-31|111|2|Jackets
002|2010-12-31|12|2010-12-31|111|1|Caps...
2,263
Posted By agama
About to post a similar approach when I saw yours...
About to post a similar approach when I saw yours go up. I think you have a typo (bold):


awk 'NR==FNR{f1[$2]= $2 FS $7 FS $8 FS $9 FS $10;next} $1 in f1 {print f1[$1]}'


And the way I read...
2,543
Posted By vgersh99
nawk -F'[<>]' 'FNR==NR{f1[$1];next} /SimpleData...
nawk -F'[<>]' 'FNR==NR{f1[$1];next} /SimpleData name/ {if($3 in f1)print;next}1' textFileWithCodes myKMLfile
782
Posted By Chubler_XL
Slight improvement - ensure zero counts are...
Slight improvement - ensure zero counts are printed, no need to call external sort:

awk '{a[int($2/10)]++}END{while(++i<11) print i*10-9 "-" i*10, 0+a[i-1]}' infile
1,651
Posted By alister
Some special variables that AWK sets for each...
Some special variables that AWK sets for each record (usually a line) that it reads:

NR = record number (by default the record separator, RS, is a newline, so NR is often the current line number)....
7,197
Posted By yazu
If you can sort data then to show: sort |...
If you can sort data then to show:

sort | uniq -d < YOURFILETo remove:

sort | uniq -u < YOURFILEThere are sort and uniq in MSYS or Cygwin or GNU utils for Windows.
2,664
Posted By Haqa
Ahh, yes, the standard find command on HP-UX only...
Ahh, yes, the standard find command on HP-UX only accepts blocks (512 Bytes) or bytes as parameters for the size option. The default is blocks so, your 100k would be "-size +200" or "-size +102400c"....
1,677
Posted By Scrutinizer
&&m is so that if there is more than one line...
&&m is so that if there is more than one line that starts with 'e' the line does not get printed more than once.. If that never happens it can be left out.
1,194
Posted By Peasant
Here is my try aswell for the entire operation. ...
Here is my try aswell for the entire operation.


BEGIN {
frmt="%-20s \t %-20s \t %-20s \t %-20s \t %-20s \n"
dash=sprintf (frmt,"FILE_TYPE","START","END","DURATION","THRESHOLD")
print dash...
1,199
Posted By matrixmadhan
I am trying to read some tutorial , but I do not...
I am trying to read some tutorial , but I do not have enough time to do it !

This is not correct. Nobody here has time as well.
So, you have to spend time in learning the tutorial, make your...
3,327
Posted By ctsgnb
@cgkmal @rdcwayx @alister I just wanted...
@cgkmal
@rdcwayx
@alister

I just wanted to pointed out a potential unexpected behaviour :

If one of the considered a[FNR] fields of the scanned files has the value 0

the code :
...
1,316
Posted By ni2
Strange it worked for me. $awk '/Application :...
Strange it worked for me.
$awk '/Application : /{app=$3}/=== INCIDENT ==== / {print app}' file5
SPVP0005P.S. file5 has a copy of the data you posted.
855
Posted By alister
Ha! That hadn't occurred to me. I took it as a...
Ha! That hadn't occurred to me. I took it as a school teacher driven to unix scripting by the same budgetary constraints which sacked the sysadmin (not unlike the biologists and geneticists that...
1,312
Posted By ctsgnb
Please post an example of input and expected...
Please post an example of input and expected output then people will be able to provide a more accurrate help

---------- Post updated at 11:59 AM ---------- Previous update was at 11:56 AM...
1,704
Posted By mirni
how about hr=0; while [ $hr -lt 24 ]; do ...
how about

hr=0;
while [ $hr -lt 24 ]; do
[[ $hr -lt 10 ]] && fname=data_file.$DATE_YYMMDD0${hr}.Z
[[ $hr -ge 10 ]] && fname=data_file.$DATE_YYMMDD${hr}.Z
[[ ! -f "$fname" ]] && echo...
4,642
Posted By Chubler_XL
Great solution rdcwayx, Just a couple of...
Great solution rdcwayx,

Just a couple of slight tweaks to stop false positives (Bug Fix must start 3rd line) and also support number without proceeding letters (think that is what ##### was...
1,776
Posted By Chubler_XL
Rdcwayx, probably best to use emp# rather than...
Rdcwayx, probably best to use emp# rather than name as your hash - just in case the data has two employees with the same name.

awk '{a[$2 FS $3]=$4; b[$3];c[$2]=$1}
END { printf...
2,458
Posted By Corona688
I'm hoping by "decrypt" you just mean "decode". ...
I'm hoping by "decrypt" you just mean "decode". It's hex, of course. Whether the raw binary data it represents is meaningful, I can't say.

In BASH, I can translate this from hex to binary via...
4,607
Posted By Chubler_XL
Looks like there were a couple of slight issues...
Looks like there were a couple of slight issues with the solution posted:

length is an awk function and should be used as a variable name
image magic draw function requires text x,y 'string'
...
1,752
Posted By Scrutinizer
awk 'NR==FNR{A[$3,$2]=$4;next}...
awk 'NR==FNR{A[$3,$2]=$4;next} NF>2{for(i=3;i<=NF;i+=3)$(i+2)=A[$i,$(i+1)];B[$1,$2]=$0;next} B[$1,$2]{print B[$1,$2]}' OFS='\t' ip-port.txt lookup.txt rollbackip.txt
1,691
Posted By danmero
{ rm input; awk -F"|" '{$0="delcnt"NF-1"|"$0}1' ...
{ rm input; awk -F"|" '{$0="delcnt"NF-1"|"$0}1' > input; } < input
;)
828
Posted By Scrutinizer
awk ' NF>2{f=$3;$3="B"++b; B=B (B?RS:x) $3 FS f} ...
awk ' NF>2{f=$3;$3="B"++b; B=B (B?RS:x) $3 FS f}
NF>4{f=$5;$5="A"++a; A=A (A?RS:x) $5 FS f}
NF>6{f=$7;$7="D"++d; D=D (D?RS:x) $7 FS f}
$1=$1
END {print B; print A; print...
994
Posted By Scrutinizer
sed 'N;s/\n//' file
sed 'N;s/\n//' file
994
Posted By danmero
awk 'ORS=(NR%2)?FS:RS' file or awk 'ORS=(/^...
awk 'ORS=(NR%2)?FS:RS' file
or
awk 'ORS=(/^ /)?RS:FS' file
Showing results 1 to 25 of 44

 

Featured Tech Videos

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