based on this coding:
If this is along the correct lines, the script could probably also tell the "c" values (=c8 and c9) for any volume group. Before going to that extent, and not sure if you need, want to see if this brings you in the correct direction.
If none of the replies thus far have helped you, please be more specific. I've read through this thread several times and I'm still not sure what you are looking for.
You're using terms such as Powerpath, vgimport, PV links, etc., all of which mean nothing at all to me.
If you can, explain it in generic way, posting lines of sample input file(s) and desired output, and any rules which need to be applied to get us from A to B without having to understand your infrastructure.
OK let me try to be as direct as possible:
I have a list. See example above. On one line will be the name of the Volume Group. All of the lines after that will be devices belonging to that Volume Group until a new Volume Group is reached in the list. See example above. It is easy to tell the difference between devices and Volume Groups because the devices will all start with /dev/dsk.
I want to output all of the devices pertaining to a specified Volume Group. Only the disks belonging to that Volume Group and nothing else. I will specify via a variable which Volume Group I am looking for.
Secondly, there may be multiple I/O paths to any device but the number of paths can vary. In this case, a single disk will have two or more device files starting with /dev/dsk in this list. I only want to list one device file for each physical disk. See example and sample output above. This can be distinguished by the controller id. The c represents the controller, i.e. c9t13d2 is the same physical disk as c4t13d2 but the I/O path is to a different controller.
For each unique Volume Group I want to output to a file only the unique disks for that Volume Group. I do not care which controller is used (the c number), only that the disks are unique (the t and d numbers, aka. target and device numbers).
I am sorry to have confused anyone with the technical reasoning behind this but I knew that if I did not state my purpose that people would want to know why I was doing it so that they may try to come up with alternative solutions. Hopefully this makes sense because I'm not sure how else to explain it.
Thank you everyone for your responses so far. By the way, this is an HP-UX server and there is no bash installed. Everything I do is therefore written in ksh or Posix shell (which is pretty much similar to ksh).
Well after a few days of thought this is what I was able to come up with. Please let me know if you can think of a cleaner or more efficient way of doing this.
#!/usr/bin/ksh
VG="vgabc"
for i in `strings /etc/lvmtab | awk 'BEGIN {x=0}
{
if ($0 ~ /'$VG'/ ) {getline; ++x}
if ($0 !~ /dsk/ ) {exit}
if (x == 1) { split($0, t_d_ , "dsk"); split(t_d_[2],t,"t"); split(t[2],d,"d"); print "t"d[1]"d"d[2]}
}' | sort -n | uniq`
do
strings /etc/lvmtab | grep $i | sort | head -n 1
done
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)