1834157 Members
2788 Online
110064 Solutions
New Discussion

ioscan -fnC output

 
SOLVED
Go to solution
Pete Quinn
New Member

ioscan -fnC output

Any assistance would be appreciated, I am doing a lot of disk work with SANS, with numerous paths and device names. I am curious if there is a way for me to arrange the output of ioscan so I can see the H/W path and device on one line of output:
Usual output from ioscan -kfnC disk, which is spread over 2 lines of output:
1st line of output)
disk 59 0/0/6/0/0.101.14.19.32.11.2 sdisk CLAIMED DEVICE IBM 2105800
2nd line of output)
/dev/dsk/c18t11d2 /dev/rdsk/c18t11d2
What I would like to see is the output all on one line so I can use it for cutting, scripting etc..

Thanks,
Pete
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: ioscan -fnC output

I use the attached little awk script to trim ioscan's output.


Pete

Pete
Kent Ostby
Honored Contributor

Re: ioscan -fnC output

Assuming you are running ioscan -kfnC disk, you can pipe it to the following awk script (put the following in a file called useme.awk , and call it as:

ioscan -kfnC disk | awk -f useme.awk

BEGIN {disk=0;}
/^disk/ {disk=1; path=$3; next;}
disk==0 {next;}
{printf("%-12s %-16s %-16s \n",path,$1,$2);disk=0}
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Pete Quinn
New Member

Re: ioscan -fnC output

Much appreciated Pete and Kent...
Pete Quinn
New Member

Re: ioscan -fnC output

Thanks Pete and Kent for the input.

Much Appreciated,
Pete