Sponsored Content
Top Forums Shell Programming and Scripting Basic Combination Shell Script Post 302982293 by blastit.fr on Tuesday 27th of September 2016 04:31:28 PM
Old 09-27-2016
Why not using SQL

I don't know if it's really out of purpose , but you 'll get such result using a single table in SQL.
This is a complete demo using sqlite ( sqllite3 under CYGWIN on my Windows PC

This code is limited to 4 items , just to avoid useless lines of results .
Code:
$ sqlite3
SQLite version 3.14.1 2016-08-11 18:53:32
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table colors (name text ) ;
sqlite> insert into colors values ("Black");
sqlite> insert into colors values ("Blue");
sqlite> insert into colors values ("Brown");
sqlite> insert into colors values ("Orange");
sqlite> select * from colors ;
Black
Blue
Brown
Orange

sqlite> select a.name,b.name from colors a,colors b ;
Black|Black
Black|Blue
Black|Brown
Black|Orange
Blue|Black
Blue|Blue
Blue|Brown
Blue|Orange
Brown|Black
Brown|Blue
Brown|Brown
Brown|Orange
Orange|Black
Orange|Blue
Orange|Brown
Orange|Orange

sqlite>

This is so called a Cartesian product.

Last edited by blastit.fr; 09-28-2016 at 04:57 PM..
This User Gave Thanks to blastit.fr For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need a quick basic shell script help

im trying to run the below if command ifconfig -a |grep 10.100.120.21 gives me below output inet addr:10.100.120.21 Bcast:10.100.120.255 Mask:255.255.255.0 i just want a basic shell which says if above exists then continue how would i do this? (6 Replies)
Discussion started by: eb222
6 Replies

2. Shell Programming and Scripting

Basic Shell script syntax help

Hi All, I am new to shell scripting. I have a variable which holds a numeric value.I have to check whether this variable holds a value between(0- 8),(8-17)(17-24).How do i write this syntax using if in shell scripting. Thanks Vignesh (2 Replies)
Discussion started by: vignesh53
2 Replies

3. Shell Programming and Scripting

shell script basic doubt

hi, I am new script learner, so my basic doubt is , how to store value of any command in a variable example $ ls | wc -l i want to stote the output of this in a variable c. so that i can use c in if else loop. and when do we use " ` " symbol in script.. can anyone also tell for... (5 Replies)
Discussion started by: hi2_t
5 Replies

4. Shell Programming and Scripting

Combination of case and If else in shell script

Would it be right forme to combine case statement and if else in one shell script? Would it work? (2 Replies)
Discussion started by: Pauline mugisha
2 Replies

5. Shell Programming and Scripting

Basic Shell Script Help

Lets say I wanted to create a script that would show what people are doing on my machine using the w command and refresh in about 6 seconds. What would be the easiest way to do this? I pretty much want the script to loop until I stop it. I'm using the BASH shell by the way. Help is appreciated.... (1 Reply)
Discussion started by: c4391
1 Replies

6. Shell Programming and Scripting

Basic shell script help

Im trying to make a script that simply adds a word to the last available line in a txt file without overwriting any previous lines. Ive googled this and there are great examples but no one explain what each function does, and i dont entirely understand how it works. Basically Im looking for... (7 Replies)
Discussion started by: kylecn
7 Replies

7. Shell Programming and Scripting

Select combination unique using shell script

Hi All, bash-3.00$ gzgrep -i '\ ExecuteThread:' /******/******/******/******/stdout.log.txt.gz <Jan 7, 2012 5:54:55 PM UTC> <Error> <WebLogicServer> <BEA-000337> < ExecuteThread: '414' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "696" seconds working on the request... (4 Replies)
Discussion started by: osmanux
4 Replies

8. Shell Programming and Scripting

Help! Basic shell script advice

##### (2 Replies)
Discussion started by: AidoPotato
2 Replies

9. Shell Programming and Scripting

Need a little help with my first shell script. Basic image resize script...

Hey everyone, just now joined because I didn't want to go onto Ubuntu forums and start asking about how to write shell scripts. Seems like this is a pretty active forum for exactly what I need. I'm trying to modify a shell script I found online, the end goal is to have it find all files in the... (9 Replies)
Discussion started by: mozzles
9 Replies

10. Shell Programming and Scripting

Basic Shell script - Not working

Hello, This is basic (i think). I am trying to run a shell script which would go into each folder (folder names defined in the list) and after entering would run some commands, once done, come out of the folder and continue until the list ends. Pretty basic and there are bunch of example online. ... (9 Replies)
Discussion started by: Zam_1234
9 Replies
Color::Library::Dictionary::Tango(3pm)			User Contributed Perl Documentation		    Color::Library::Dictionary::Tango(3pm)

NAME
Color::Library::Dictionary::Tango - (Tango) The Tango color palette DESCRIPTION
The Tango icon theme's goal is to make applications not seem alien on any desktop. A user running a multiplatform application should not have the impression that the look is unpolished and inconsistent with what he or she is used to. While this isn't about merging styles of all desktop systems, we do aim to not be drastically different on each platform. The Tango color palette consists of 27 RGB colors. <http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines> COLORS
Aluminium 1 aluminium1 #eeeeec Aluminium 2 aluminium2 #d3d7cf Aluminium 3 aluminium3 #babdb6 Aluminium 4 aluminium4 #888a85 Aluminium 5 aluminium5 #555753 Aluminium 6 aluminium6 #2e3436 Butter 1 butter1 #fce94f Butter 2 butter2 #edd400 Butter 3 butter3 #c4a000 Chameleon 1 chameleon1 #8ae234 Chameleon 2 chameleon2 #73d216 Chameleon 3 chameleon3 #4e9a06 Chocolate 1 chocolate1 #e9b96e Chocolate 2 chocolate2 #c17d11 Chocolate 3 chocolate3 #8f5902 Orange 1 orange1 #fcaf3e Orange 2 orange2 #f57900 Orange 3 orange3 #ce5c00 Plum 1 plum1 #ad7fa8 Plum 2 plum2 #75507b Plum 3 plum3 #5c3566 Scarlet Red 1 scarletred1 #ef2929 Scarlet Red 2 scarletred2 #cc0000 Scarlet Red 3 scarletred3 #a40000 Sky Blue 1 skyblue1 #729fcf Sky Blue 2 skyblue2 #3465a4 Sky Blue 3 skyblue3 #204a87 perl v5.14.2 2011-12-07 Color::Library::Dictionary::Tango(3pm)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy