Search Results

Search: Posts Made By: superHonda123
1,784
Posted By agama
Nothing but brute force here: awk ' ...
Nothing but brute force here:


awk '
BEGIN { fmt = "%-10s %-10s %-10s %-10s %-10s %-10s %-10s\n"; }
/Label/ { printf( fmt, $1, $2, $3 " " $4, $5, $6, $7, $8 " " $9 ); next; }

NF...
2,175
Posted By Scrutinizer
Hi Jack, I think that if you compare #5 to...
Hi Jack,

I think that if you compare #5 to #2 , you should be able to make this change yourself, no?

S.
2,175
Posted By Scrutinizer
Or stripping the script in #2 would give: awk...
Or stripping the script in #2 would give:
awk 'NR>2 && /^--/{print p; exit}{p=$0}' infile
2,175
Posted By Scrutinizer
Try: awk 'NR==1{print "Label\t\t"...
Try:
awk 'NR==1{print "Label\t\t" $0}NR==2{print "-------\t\t" $0} NR>2 && /^--/{print "Statistic\t"p; exit}{p=$0}' infile
3,478
Posted By radoulov
Don't use /usr/bin/awk on Solaris. Use nawk or...
Don't use /usr/bin/awk on Solaris. Use nawk or /usr/xpg4/bin/awk instead.
3,478
Posted By Scrutinizer
awk '{$1=$1}NF=NF>2' RS=/ infile Some awks: ...
awk '{$1=$1}NF=NF>2' RS=/ infile

Some awks:
awk 'NF=NF>2' RS=/ infile
3,478
Posted By ctsgnb
awk -F"[ /]" '{print $(NF-2)}' inputfile
awk -F"[ /]" '{print $(NF-2)}' inputfile
3,478
Posted By CarloM
awk -v FS="[ =]" '/df0/ { print $3 }' inputfile |...
awk -v FS="[ =]" '/df0/ { print $3 }' inputfile | xargs -L1 basenameor if you want to pass the value in from a script:
srch="df0";
awk -v FS="[ =]" -vval=$srch '$0 ~ val { print $3 }' inputfile |...
3,478
Posted By itkamaraj
$ awk -F"[ /]" '/df0/ {print $6}' input.txt ...
$ awk -F"[ /]" '/df0/ {print $6}' input.txt
df0_cntrl_PCPFCI20120404_68498
df0_arc_PCPFCI20120404_68499
df0_arc_PCPFCI20120404_68500
df0_arc_PCPFCI20120404_68501
df0_spfile_PCPFCI20120404_68518...
3,478
Posted By Epsilon
You can also try the following: echo...
You can also try the following:


echo "piece handle=/test123/disk_dump/test123/df0_cntrl_PCPFCI20120404_68498 tag=TAG20120404T180035 comment=NONE" | cut -d " " -f 2 |cut -d "/" -f 5


Output:...
3,478
Posted By CarloM
A variation: awk -v FS="[ =]" '{ print $3 }'...
A variation:
awk -v FS="[ =]" '{ print $3 }' inputfile | xargs -L1 basename
(should handle variable depths of path)
3,478
Posted By Corona688
awk is a handy shell language which splits its...
awk is a handy shell language which splits its inputs on columns -- by default on whitespace. But, usefully, you can tell it to use anything you want as its field separator(FS) -- including spaces,...
3,622
Posted By ygemici
# sed -e 'H;' -ne '/A tool used...
# sed -e 'H;' -ne '/A tool used by/x;s/.*\n\(.*\n.*\n\).*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n/\1/p' -e '/.*Everything OK.*/h;d' file
Wed Sep 22 16:15:25 SST 2010
Importing DEVK909562 to client...
3,622
Posted By rdcwayx
awk ' / 2010$/||/^Importing/{s=s RS $0;next} ...
awk '
/ 2010$/||/^Importing/{s=s RS $0;next}
/^meaning:/ {
getline
if ($0~"A tool used by tp produced warnings")
{print s RS $0}
...
3,622
Posted By rdcwayx
awk ' {s=s RS $0} /^meaning:/ { ...
awk '
{s=s RS $0}
/^meaning:/ {
getline
if ($0~"A tool used by tp produced warnings")
{print s RS $0}
else {s=""}
...
4,364
Posted By pravin27
hi, Try this, yr=`date '+%Y'` ;...
hi,

Try this,


yr=`date '+%Y'` ; dt=`date '+%d'`;mon=`date '+%b'`
awk -v v1=$dt -v v2=$mon -v v3=$yr '{v1=v1+0;if(v2==$3 && v3==substr($5,1,length($5)-1) && v1==substr($4,1,(length($4) -1)))...
Forum: HP-UX 08-25-2010
7,444
Posted By vbe
What your OS is saying is that it has no such...
What your OS is saying is that it has no such filesystems to mount... ( not the mount points...).
I would start by looking if the VG is available :

vgdisplay vgsap
# If youre prompted:...
5,476
Posted By pravin27
Hi, This will work. awk -v v1=`date...
Hi,

This will work.

awk -v v1=`date +'%h'` -v v2=`date +'%d' | sed 's/^0//g'` '{if($5==v1 && $6==v2) { print }}' infile
5,476
Posted By Klashxx
outdated awk version? No problem for me: ...
outdated awk version?

No problem for me:

# cat kk
root pts/tb userpc Tue Aug 9 11:23 - 11:23 (00:00)
root pts/tb userpc Tue Aug 9 11:22 - 11:20 (00:00)
root pts/ta userpc Tue Aug 2 10:46 -...
5,476
Posted By Klashxx
Based on your code: last -R|awk -v v1=`date...
Based on your code:
last -R|awk -v v1=`date +'%h'` -v v2=`date +'%d'` '$5==v1 && $6==v2'
5,476
Posted By pravin27
Something like this, awk -v v1=`date...
Something like this,


awk -v v1=`date +'%h'` -v v2=`date +'%d' | sed 's/^0//g'` '{if($5==v1 && $6==v2) { print }}' infile
5,476
Posted By gaithrit
If wanted to extract the data according to...
If wanted to extract the data according to current date like "Aug 11" and test1 is the data file, the below command works.

bash-3.00$ cat test1
root pts/ta userpc Wed Aug 11 09:46 -...
1,808
Posted By ygemici
# grep `hostname|tr '[:lower:]' '[:upper:]'`...
# grep `hostname|tr '[:lower:]' '[:upper:]'` /etc/hosts
1,808
Posted By fpmurphy
No need for grep if you are using gawk. You can...
No need for grep if you are using gawk. You can turn case insensitivity on using IGNORECASE.

$ cat /etc/hosts
127.0.0.1 localhost
::1 localhost
....
192.168.0.115 ...
1,808
Posted By KenJackson
Here's my script for printing the local IP. ...
Here's my script for printing the local IP.

I prefer to get the actual address from the network device instead of the address it's supposed to be in /etc/hosts. But some of my machines have the...
Showing results 1 to 25 of 42

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