Sponsored Content
Top Forums Shell Programming and Scripting How to generate all combinations of group lists at the same time? Post 302995926 by RudiC on Saturday 15th of April 2017 01:41:53 AM
Old 04-15-2017
My python is non-existent, but I guess what you post just uses an array of constants and doesn't read and loop your input file.
And, I don't think Don Cragun was talking of copying google results into here, but trying to compose something on your own after (hopefully) having learned from the suggestions you received in here.
Try
Code:
awk '{for (i=1; i<=NF; i++) for (j=i+1; j<=NF; j++) print $i, $j}' file
a b
a c
a d
b c
b d
c d
E F
E G
E H
F G
F H
G H

These 2 Users Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Combinations

Hello All, i have two files, one of the format A 123 B 124 C 234 D 345 And the other A 678 B 789 C 689 D 567 I would like to combine them into one file with three columns: A 123 678 B 124 789 C 234 689 (4 Replies)
Discussion started by: Khoomfire
4 Replies

2. Shell Programming and Scripting

Shell Script to Create non-duplicate lists from two lists

File_A contains Strings: a b c d File_B contains Strings: a c z Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below. Resultant... (7 Replies)
Discussion started by: mlv_99
7 Replies

3. Shell Programming and Scripting

Generate array name at run time Korn shell

Hi, I am trying to define number of array based on constant derived during execution phase of a script. Here is what i am trying.. #First Part, Get LUN input from User lun_count=4 count=0 set -A my_lun while : do while ]; do read L?"Enter Lun "$count" Number:" ... (2 Replies)
Discussion started by: harris2107
2 Replies

4. AIX

Want to find the last access time for large group of files at one go

Dear All, I'm working as a DBA and dont have much knowledge at OS level commands.we have requirement that we need find the files which has been last accessed >= apr 2010and also access date <= apr 2010 for a large set of files.Do know some commands likeistat, ls -u.But can anyone provide me the... (4 Replies)
Discussion started by: dbanrb
4 Replies

5. Shell Programming and Scripting

How to make diff show differences one line at a time and not group them?

Is there a way to tell diff to show differences one line at a time and not to group them? For example, I have two files: file1: line 1 line 2 line 3 diff line 4 diff line 5 diff line 6 line 7 file2: line 1 line 2 line 3 diff. line 4 diff. line 5 diff. line 6 line 7 (13 Replies)
Discussion started by: mmr11408
13 Replies

6. Shell Programming and Scripting

Generate a Execution time reports using log files.

Hi Experts, I am having a requirement, where i need to generate a report of the execution time of all the processes. All the processes generate the log files in a log directory and I can get the execution time from the log files. like below is the log file. /home/vikas/log >ls -l... (2 Replies)
Discussion started by: k_vikash
2 Replies

7. Shell Programming and Scripting

All possible combinations

Hi, I have an input file like this a b c d I want to print all possible combinations between these records in the following way aVSb aVSc aVSd bVSc bVSd cVSd VS indicates versus. All thoughts are appreciated. (5 Replies)
Discussion started by: jacobs.smith
5 Replies

8. Shell Programming and Scripting

• Write a shell script that upon invocation shows the time and date and lists all the logged-in user

help me (1 Reply)
Discussion started by: sonu pandey
1 Replies

9. Shell Programming and Scripting

Process 2 lists at the same time and move files.

I have this while loop, that works but is quite slow to process though. I'm hopping there might be a faster/better way to find what I'm looking for. I have 2 lists of numbers, and want to only find files where a file name has both values present. each list has about 100 values. while... (10 Replies)
Discussion started by: whegra
10 Replies
listdgrp(1M)						  System Administration Commands					      listdgrp(1M)

NAME
listdgrp - lists members of a device group SYNOPSIS
/usr/bin/listdgrp dgroup... DESCRIPTION
listdgrp displays the members of the device groups specified by the dgroup list. EXAMPLES
Example 1 An example of listdgrp. The following example lists the devices that belong to group partitions: example% listdgrp partitions root swap usr EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 Command was syntax incorrect, an invalid option used, or an internal error occurred. 2 A device group table could not be opened for reading. 3 A device group dgroup could not be found in the device group table. FILES
/etc/dgroup.tab Device group table. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
putdgrp(1M), attributes(5) SunOS 5.11 5 Jul 1990 listdgrp(1M)
All times are GMT -4. The time now is 12:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy