Now i did manually by changing each code of line one by one.. Could you please check it now..
Hi,
Some part of output:
================
$ hwmgr show scsi
SCSI DEVICE DEVICE DRIVER NUM DEVICE FIRST
HWID: DEVICEID HOSTNAME TYPE SUBTYPE OWNER PATH FILE VALID PATH
-------------------------------------------------------------------------
68: 0 mullins disk none 0 1 dsk0 [0/0/0]
69: 1 mullins disk none 0 1 dsk1 [0/1/0]
71: 4 mullins disk none 0 4 scp0 [2/0/0]
72: 5 mullins disk none 2 4 dsk2 [2/0/3]
73: 6 mullins disk none 2 4 dsk3 [2/0/4]
74: 7 mullins disk none 2 4 dsk4 [2/0/6]
75: 8 mullins disk none 2 4 dsk5 [2/0/7]
76: 9 mullins disk none 2 4 dsk6 [2/0/8]
77: 10 mullins disk none 0 4 dsk7 [2/0/9]
78: 11 mullins disk none 0 4 dsk8 [2/0/10]
79: 12 mullins disk none 0 4 dsk9 [2/0/11]
80: 13 mullins disk none 0 4 dsk10 [2/0/12]
================================================================
Main intention of doing this is to meet BID value=35 by using required number of disks.
a[x]=x (unknown value to programmer)varies from machine to machine.
And a[x] value can be found from below code ..
hwmgr show scsi > scsi.tmp
while read line; do
a[x]=`echo $line | grep "dsk" | awk '{ print $7 }'`
Coming to BID concept:
--------------------------------
BID value =(No of partitions * NUM PATH value).
In general each disk has 4 partitions (a,b,g,h) and and for each partition(a,b,g,h) their wll be NUM PATH value.Each partition NUM PATH value will be equal to NUM PATH value of that particular disk.
Example:- Suppose dsk1 has NUM PATH=4 then partition "a" has Total number of paths=4 partition "b" total number of paths=4 Partition "g" total number of paths=4 partition "h" total number of paths=4 Hence,if you use dsk1 then we can have BID value=(No of partitions * NUM PATH)=4*4=16.
So our requirement is to meet BID value=35.
After getting NUM PATH value by above code,we must use the required number of disks to meet BID=35.
Example:Let say dsk2 and dsk3 has NUMPATH=4 then we can get BID value=16+16=32) Still we didnt meet BID=35 and here we must note that we can't use the disk which has NUM PATH=4 now at this stage because 32+4=36 (not equal to 35) so we must use less than NUM PATH=4 , say if you find NUM PATH=1(less than NUM PATH=4)so we can proceede and here we must check how many partitions to be used to meet BID value=35.In this case only 3 partitions are required which has NUM PATH=1 so finally
32+3=35..
========================================================
I wrote the below code as per my above information..
Could you check it and correct me if you have better idea..
Request you to please provide inputs for this...
First off, the following possible modification:
just do that grep once (perhaps even as part of the hwmgr command)
Unsure of you logic - what you are trying to do. It seems that you are trying to gigure out how to add up multiples of four and multiples of one to make 35. Then still, unclear on your goal.
Finally, your asked to check and correct. Well, is there something wrong with the code or the results? Or, are you just tryign to see if a better way?
Dear all,
I am using sed as an alternative to grep in order to get a specific line from each of multiple files located in the same directory. I am using sed because it prints the lines in the correct order (unlike grep).
When I write sed code that prints out the output I get it correct, but... (1 Reply)
Hi everyone,
The following piece of awk code works fine if I use eval builtin
var='$1,$2'
ps | eval "awk '{print $var}'"
But when I try to knock off eval and use awk variable as substitute then I am not getting the expected result
ps | awk -v v1=$var '{print v1}' # output is $1,$2
ps |... (4 Replies)
Hello Brains,
I was trying to develop a script that would do nslookup using both name and ip of server and format the output and store in an output file. Please find the script below.
#!/usr/bin/ksh
cat $1 | tr "" "" |
while read ip name
do
ERROR="$(nslookup $ip | grep can't | awk -F"... (2 Replies)
Hello all; hope someone can help me cause I am going crazy trying to find a solution for (what I think is simple) issue...looked hard up and down this forum and tried several "solutions" with no avail...so here's my issue:
I have this (parent) script: copylsofdcmcadefttosftpwithmove.sh
... (3 Replies)
Dear All
On my Linux server, I need to separate the individual logs coming from various modules concurrently. Please find below a sample of the logs:
But when I run it, I am receiving the following error:
-bash: -f1.log : command not found
-bash: $LOGFILE : ambiguous redirect
Can you... (4 Replies)
I am new to solaris and I replaced a faulty tape drive sun DLT7000
But, I am getting the follwoing error when system reboots
ltid deamon error drive index 1 is not correct, drive name /dev/rmt/2cbn is incorrect no such file or directory.
I have two drives the other one is /dev/rmt/0cbn,... (8 Replies)
I have input file like this
Input file:
ABC|abc_etc_passwd
XYZ|XYZ_etc_passwd
zXY|XYZ_etc_passwd
IJK|test_etc_passwd
KLM|test_etc_passwd
i want to do following in a loop.
grep 'ABC' *abc_etc_passwd*
grep 'XYZ' *XYZ_etc_passwd*
grep 'ZXY' *ZXY_etc_passwd*
i have tried this
for i... (2 Replies)