Search Results

Search: Posts Made By: aix_admin_007
24,758
Posted By Scrutinizer
Try: inq | awk -F'[/ ]' '/5773/{print $4}' ...
Try:
inq | awk -F'[/ ]' '/5773/{print $4}'
or
inq | awk '/5773/{sub(/.*\//,x,$1); print $1}'
24,758
Posted By Yoda
sed 's#//r##'
sed 's#//r##'
1,778
Posted By rdrtx1
using infile: 3EFC 10000000c97239cf FIBRE ...
using infile:
3EFC 10000000c97239cf FIBRE FA7D:0
10000000c96fc9f1 FIBRE FA10D:0
3EFD 10000000c97239cf FIBRE FA7D:0
10000000c96fc9f1 FIBRE FA10D:0
3EFE ...
1,778
Posted By msabhi
perl -alne '{if(/^\d/)...
perl -alne '{if(/^\d/) {$val=$F[0];$F[3]=~s/.*?-(\w+):(\d)/$1 $2/;print "$F[0] $F[1] $F[3]";} else{ if(/^100/){$F[2]=~s/.*?-(\w+):(\d)/$1 $2/;print "$val $F[0] $F[2]";next;}}}'


I thought this...
3,199
Posted By rdrtx1
should sed script be: sed 's/-/ /g'?
should sed script be:
sed 's/-/ /g'?
3,199
Posted By rdrtx1
also try: add one more process after: | sed...
also try: add one more process after:
| sed s/-//g
| awk '/^ *$/{next;} length($1)!=4 { $0=l " " $0; } {l=$1 ; gsub("[:-]"," "); $3=$4="";} 1'
3,199
Posted By msabhi
perl -alne '{if(/^\d/)...
perl -alne '{if(/^\d/) {$val=$F[0];$F[3]=~s/.*?-(\w+):(\d)/$1 $2/;print "$F[0] $F[1] $F[3]";} else{
if(/^ +/){$F[2]=~s/.*?-(\w+):(\d)/$1 $2/;print "$val $F[0] $F[2]";next;}}}' input_file


Hope...
3,199
Posted By pamu
Hope I Got your requirement right. Try.....
Hope I Got your requirement right.

Try.. assuming some points here

awk -F "FIBRE FA-|:| " '/FIBRE/{if($0 !~ /^1000/){s=$1;$1=$1}else{$1=s" "$1}}1' file | sort
3,109
Posted By agama
Have a go with these small changes: if ! ...
Have a go with these small changes:


if ! lpar-command | awk '
/^Name/ { next; }
/^---/ { next; }
{
state[$2] = state[$2] $1 " ";
if( $2 == "A" )
acount++;
else
...
6,205
Posted By rdrtx1
Try: add to the top of script: find ./ \( -name...
Try: add to the top of script:
find ./ \( -name . -o -prune \) -type f -mtime -7 -name temporary_log_file -exec rm -f {} \;
then add change to line:
' date="$(date)" >> temporary_log_file
6,205
Posted By rdrtx1
try: lpar-command | awk ' /^Name/ {...
try:

lpar-command | awk '
/^Name/ { next; }
/^---/ { next; }
{
state[$2] = state[$2] $1 " ";
if( $2 == "A" )
acount++;
else
others++;
}
END {
if...
3,109
Posted By agama
Not quite the way to get date in. From inside of...
Not quite the way to get date in. From inside of awk you cannot use backquotes like that. This is one way which should work with even older awks. I haven't used an AIX system since about 2001, and...
3,109
Posted By agama
Small changes to generate the total counts: ...
Small changes to generate the total counts:


awk '
/^Name/ { next; }
/^---/ { next; }
{
state[$2] = state[$2] $1 " ";
if( $2 == "A" )
acount++;
else
others++;...
1,533
Posted By agama
Agree with spacebar -- can be simplified. My...
Agree with spacebar -- can be simplified. My thoughts:


lswpar | awk '
/^Name/ { next; }
/^---/ { next; }
{ state[$2] = state[$2] $1 " "; }
END {
printf( "====...
1,533
Posted By spacebar
Check out the below code, I believe it will make...
Check out the below code, I believe it will make doing what you want a little simpler:
$ cat t
Name State Type Hostname Directory RootVG WPAR...
Showing results 1 to 15 of 15

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