Sponsored Content
Top Forums Shell Programming and Scripting Do nothing if column1 is found Post 302959243 by RudiC on Friday 30th of October 2015 01:26:00 PM
Old 10-30-2015
You've got several syntactical and semantical errors, e.g.
- while read; do ... done is not met
- if ... fi is not met
- mail ... $COL1 < $COL1 uses $COL as the URL and tries to read from it at the same time

But, in the first place, as Yoda pointed out, the entire if branch will never be executed as COL1 read from database will always be found in database...

Last edited by RudiC; 10-30-2015 at 02:33 PM..
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

only if column1 equals this print that

I have text file with hundreds of lines, space delimited, each line has the same amount of "columns" and the same amount of characters in each, Column 1, Column 2, and Column 3. I need a script that will print all columns of the "current" line along with the last two columns of the next line ONLY... (3 Replies)
Discussion started by: ajp7701
3 Replies

2. Shell Programming and Scripting

awk - replacing stings in file1 with column1 in file2

Hello, I've never used awk before, but from what I've read, it will best suit what I'm trying to do. I have 2 files. I need to replace strings in file1 with the first column of a matching string in file2. Below are examples: File1: random-string1 1112 1232 3213 2131 random-string2... (7 Replies)
Discussion started by: upstate_boy
7 Replies

3. Shell Programming and Scripting

delete a string on column1

Hi I have a file with multiple columns. But there is something weird on column one that is attached to the name. The good thing is that its a consistent pattern so there should be a way to remove it. So the first column looks something like this: name_345.4ml date_3456.4ml year_12.4ml... (3 Replies)
Discussion started by: kylle345
3 Replies

4. Shell Programming and Scripting

Getting rip of multiple rows based on column1

Hi, I want to get rid of multiple rows (duplicate, triplicate etc..) for only column 1. e.g. iu 2 iu 1 iu 3 k 4 jk 3 nm 4 nm 2 output k 4 jk 3 thanks (7 Replies)
Discussion started by: phil_heath
7 Replies

5. Shell Programming and Scripting

awk : Remove column1 and last column in a line

Hi All, How to remove col1 and last column in a line. Please suggest some awk stuffs. Input col1 col2 col3 col4 col1 col2 col3 col4 col5 col1 col2 col3 col4 col1 col2 col3 Output Processing col2 col3 ... Processing col2 col3 col4 ... Processing col2 col3 ... Processing... (5 Replies)
Discussion started by: k_manimuthu
5 Replies

6. Shell Programming and Scripting

How to change value in CSV columns and compare two files where Column1 is identical

Hi all, Could someone help me with the following issue: 1st I have an CSV file delimiter is ";" I I have a column 7 where I need to do some multiple mathem. operation, I need all values in this columns to be multiplied by 1.5 and create a new CSV file with the replaced values. 2nd. I... (3 Replies)
Discussion started by: kl1ngac1k
3 Replies

7. Shell Programming and Scripting

Replace text in column1 of a file matching columns of another file

Hi all, I have 2 files: species-names.txt Abaca-bunchy-top-virus ((((Abaca-bunchy-top-virus((Babuvirus((Unassigned((Nanoviridae((Unassigned)))) Abutilon-mosaic-virus ((((Abutilon-mosaic-virus((Begomovirus((Unassigned((Geminiviridae((Unassigned))))... (2 Replies)
Discussion started by: thienxho
2 Replies

8. Shell Programming and Scripting

Help with Perl script for identifying dupes in column1

Dear all, I have a large dictionary database which has the following structure source word=target word e.g. book=livre Since the database is very large in spite of all the care taken, it so happens that at times the source word is repeated e.g. book=livre book=tome Since I want to... (7 Replies)
Discussion started by: gimley
7 Replies

9. Programming

Perl script to merge cells in column1 which has same strings, for all sheets in a excel workbook

Perl script to merge cells ---------- Post updated at 12:59 AM ---------- Previous update was at 12:54 AM ---------- I am using below code to read files from a dir and print to excel. open(my $in, '<', $file) or die "Could not open file: $!"; my $rowCount = 0; my $colCount = 0;... (11 Replies)
Discussion started by: Jack_Bruce
11 Replies

10. Shell Programming and Scripting

CSV File:Filter duplicate records from column1 & another column having unique record

Hi Experts, I have csv file with 30, 40 columns Pasting just 2 column for problem description. Need to print error if below combination is not present in file check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same. For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies
mediator(7D)							      Devices							      mediator(7D)

NAME
mediator - support for HA configurations consisting of two strings of drives DESCRIPTION
Beginning with a prior version, Solaris Volume Manager provided support for high-availability (HA) configurations consisting of two hosts that share at least three strings of drives and that run software enabling exclusive access to the data on those drives from one host. (Note: Volume Manager, by itself, does not actually provide a high-availability environment. The diskset feature is an enabler for HA con- figurations.) Volume Manager provides support for a low-end HA solution consisting of two hosts that share only two strings of drives. The hosts in this type of configuration, referred to as mediators, run a special daemon, rpc.metamedd(1M). The mediator hosts take on additional responsibil- ities to ensure that data is available in the case of host or drive failures. In a mediator configuration, two hosts are physically connected to two strings of drives. This configuration can survive the failure of a single host or a single string of drives, without administrative intervention. If both a host and a string of drives fail (multiple fail- ures), the integrity of the data cannot be guaranteed. At this point, administrative intervention is required to make the data accessible. The following definitions pertain to a mediator configuration: diskset A set of drives containing metadevices and hot spares that can be shared exclusively (but not concurrently) by two hosts. Volume Manager state database A replicated database that stores metadevice configuration and state information. mediator host A host that runs the rpc.metamedd(1M) daemon and that has been added to a diskset. The mediator host participates in checking the state database and the mediator quorum. mediator quorum The condition achieved when the number of accessible mediator hosts is equal to half+1 the total number of configured mediator hosts. Because it is expected that there will be two mediator hosts, this number will normally be 2 ([(2/2) + 1] = 2.) replica A single copy of the Volume Manager metadevice state database. replica quorum The condition achieved when the number of accessible replicas is equal to half+1 the total number of configured replicas. For example, if a system is configured with ten replicas, the quorum is met when six are accessible ([(10/2) + 1 = 6]). A mediator host running the rpc.metamedd(1M) daemon keeps track of replica updates. As long as the following conditions are met, access to data occurs without any administrative intervention: o The replica quorum is not met. o Half of the replicas are still accessible. o The mediator quorum is met. The following conditions describe the operation of mediator hosts: 1. If the is met, access to the diskset is granted. At this point no mediator host is involved. 2. If the replica quorum is not met, half of the replicas are accessible, the mediator quorum is met, and the replica and mediator data match, access to the diskset is granted. The mediator host contributes the deciding vote. 3. If the replica quorum is not met, half of the replicas are accessible, the mediator quorum is not met, half of the mediator hosts is accessible, and the replica and mediator data match, the system prompts you to grant or deny access to the diskset. 4. If the replica quorum is not met, half of the replicas are accessible, the mediator quorum is met, and the replica and mediator data do not match, access to the diskset is read-only. You can delete replicas, release the diskset, and retake the diskset to gain read-write access to the data in the diskset. 5. In all other cases, the diskset access is read-only. You can delete replicas, release the diskset, and retake the diskset to gain read-write access to the data in the diskset. The metaset(1M) command administers disksets and mediator hosts. The following options to the metaset command pertain only to administering mediator hosts. -a -m mediator_host_list Adds mediator hosts to the named set. A mediator_host_list is the nodename of the mediator host to be added and up to 2 other aliases for the mediator host. The nodename and aliases for each mediator host are separated by commas. Up to 3 mediator hosts can be specified for the named diskset. -d -m mediator_host_list Deletes mediator hosts from the named diskset. Mediator hosts are deleted from the diskset by specifying the nodename of mediator host to delete. -q Displays an enumerated list of tags pertaining to ``tagged data'' that may be encountered during a take of the ownership of a diskset. -t [-f] -y Takes ownership of a diskset safely, unless -f is used, in which case the take is unconditional. If metaset finds that another host owns the set, this host will not be allowed to take ownership of the set. If the set is not owned by any other host, all the disks within the set will be owned by the host on which metaset was exe- cuted. The metadevice state database is read in and the shared metadevices contained in the set become accessi- ble. The -t option will take a diskset that has stale databases. When the databases are stale, metaset will exit with code 66, and a message will be printed. At that point, the only operations permitted are the addition and deletion of replicas. Once the addition or deletion of the replicas has been completed, the diskset should be released and retaken to gain full access to the data. If mediator hosts have been configured, some addi- tional exit codes are possible. If half of the replicas and half of the mediator hosts are operating properly, the take will exit with code 3. At this point, you can add or delete replicas, or use the -y option on a subse- quent take. If the take operation encounters ``tagged data,'' the take operation will exit with code 2. You can then run the metaset command with the -q option to see an enumerated list of tags. -t [-f] -u tagnumber Once a tag has been selected, a subsequent take with -u tagnumber can be executed to select the data associ- ated with the given tagnumber. SEE ALSO
metaset(1M), md(7D), rpc.metamedd(1M), rpc.metad(1M) Sun Cluster documentation, Solaris Volume Manager Administration Guide NOTES
Diskset administration, including the addition and deletion of hosts and drives, requires all hosts in the set to be accessible from the network. SunOS 5.11 20 Jun 2008 mediator(7D)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy