Sponsored Content
Top Forums Shell Programming and Scripting Multidimensional arrays Shell Programming and Scripting Post 303001680 by SULTAN01 on Wednesday 9th of August 2017 11:22:05 AM
Old 08-09-2017
Multidimensional arrays Shell Programming and Scripting

I have two files:

file-1 is a list of number of interfaces in the switch and file-2 have VLAN-ID , VLAN-NAME , Interface belong to that VLAN like this:

file-1:

Code:
1/1
1/2
1/3
1/4
1/5
.
.

file-2:

Code:
1,"vlan-wifi",1/1,1/7,1/8
2,"vlan-admin",1/3,1/5/1/6
3," " ,3/3,1/3

I'm trying to use these files to create table:
Code:
VLAN-ID | VLAN-NAME |1/1|1/2|1/3|1/4|1/5|1/6|1/7|1/8|1/9|1/10|.....
    1   |  vlan-wifi| * |   |   |   |   |   | * | * |   |    |
    2   | vlan-admin|   |   | * |   | * | * |   |   |   |    |

How can I achieve this?


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 08-09-2017 at 12:47 PM.. Reason: Changed ICODE to CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multidimensional arrays

I have a file that's logically in the form of a multidimensional array with an unknown number of records in the file. The file looks like this: name1 data1 name2 data2 name3 data3 ... nameN dataN How do I load this file into an array for processing, while... (2 Replies)
Discussion started by: leslie02
2 Replies

2. Shell Programming and Scripting

Shell Programming and Scripting

Hi, iam having the file as follows: ABCDEFGH|0987654321234567 ABCDEFGH|0987654321234523 ABCDEFGH|0987654321234556 ABCDEFGH|0987654321234545 POIUYTRE|1234567890890678 POIUYTRE|1209867757352567 POIUYTRE|5463879088797131 POIUYTRE|5468980091344456 pls provide me the split command ... (14 Replies)
Discussion started by: nivas
14 Replies

3. Shell Programming and Scripting

Shell Programming and Scripting

I want to compare some files. say iam having 2 sets of files ,each is having some 10 files. ie, file1 1a.txt 1b.txt 1c.txt ... file2 2a.txt 2b.txt 2c.txt ... i need to read line by line of this files parralley.. ie.. i want to read file1 first line that is 1a.txt and file2... (2 Replies)
Discussion started by: nivas
2 Replies

4. Shell Programming and Scripting

Shell Programming and Scripting

Hi, Iam having the files as follows: file1 aa aa aa aa ab ac ad ae file2 aa aa ab Outputfile: (20 Replies)
Discussion started by: nivas
20 Replies

5. UNIX for Dummies Questions & Answers

Concatenating arrays cell values in shell scripting

Hi All, I want to concatenate the array cell values and form a string.. Is it possible? for ex. I have an array word_array contains d u m b and after concatenating the string shld be 'dumb' thanks (2 Replies)
Discussion started by: mathur
2 Replies

6. Programming

C programming working with multidimensional array

Hi, I have the following variable declaration which looks like a 3d array or N matrixs KxK of floats float (*table); I have to pass to a function only the first table. How can I do it?? Thanks (6 Replies)
Discussion started by: littleboyblu
6 Replies

7. Shell Programming and Scripting

multidimensional arrays using awk

i'm trying to use awk to count a listing similar to the following and get a report of the listing similar to the one below it. y,pizza n,pizza y,pizza y,pizza n,tomato n,tomato y,cheese y,cheese n,cheese report ---- pizza,3,1 tomato,0,2 cheese,2,1 (1 Reply)
Discussion started by: multimulti
1 Replies

8. Programming

Multidimensional arrays and sort.

My language is C++. I have a multidimensional vector that I would like to sort by a specific "cell" or "field" within the main vector. Does anyone have any information on how to do this? I have searched all over the internet and every reference manual I can find. So far I have found very little to... (2 Replies)
Discussion started by: sepoto
2 Replies

9. Shell Programming and Scripting

Multidimensional arrays

Hi Experts, I'm a newbie.....multidimensional arrays in shell scripts is possible??? If so, can anyone guide me with an example.....and also can anyone tell me, how we can create a table like ouput format in shell script....the output should look like this one: 1 2 3 4 5 6 6 5 4 3... (4 Replies)
Discussion started by: kritibalu
4 Replies

10. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
VLAN(4) 						   BSD Kernel Interfaces Manual 						   VLAN(4)

NAME
vlan -- IEEE 802.1Q VLAN network interface SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device vlan Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): if_vlan_load="YES" DESCRIPTION
The vlan driver demultiplexes frames tagged according to the IEEE 802.1Q standard into logical vlan network interfaces, which allows rout- ing/bridging between multiple VLANs through a single switch trunk port. Each vlan interface is created at runtime using interface cloning. This is most easily done with the ifconfig(8) create command or using the cloned_interfaces variable in rc.conf(5). To function, a vlan interface must be assigned a parent interface and numeric VLAN tag using ifconfig(8). A single parent can be assigned to multiple vlan interfaces provided they have different tags. The parent interface is likely to be an Ethernet card connected to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. vlan initially assumes the same minimum length for tagged and untagged frames. This mode is selected by setting the sysctl(8) variable net.link.vlan.soft_pad to 0 (default). However, there are network devices that fail to adjust frame length when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with vlan after changing the value of net.link.vlan.soft_pad to 1. In the latter mode, vlan will pad short frames before tagging them so that their length is not less than the minimum value after untagging by the non-compliant devices. HARDWARE
The vlan driver supports efficient operation over parent interfaces that can provide help in processing VLANs. Such interfaces are automati- cally recognized by their capabilities. Depending on the level of sophistication found in a physical interface, it may do full VLAN process- ing or just be able to receive and transmit long frames (up to 1522 bytes including an Ethernet header and FCS). The capabilities may be user-controlled by the respective parameters to ifconfig(8), vlanhwtag, and vlanmtu. However, a physical interface is not obliged to react to them: It may have either capability enabled permanently without a way to turn it off. The whole issue is very specific to a particular device and its driver. At present, these devices are capable of full VLAN processing in hardware: ae(4), age(4), alc(4), ale(4), bce(4), bge(4), bxe(4), cxgb(4), cxgbe(4), em(4), igb(4), ixgb(4), ixgbe(4), jme(4), msk(4), mxge(4), nxge(4), nge(4), re(4), sge(4), stge(4), ti(4), txp(4), and vge(4). Other Ethernet interfaces can run VLANs using software emulation in the vlan driver. However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to vlan will result in a reduced MTU on the corresponding vlan interfaces. In the modern Internet, this is likely to cause tcp(4) connectivity problems due to massive, inadequate icmp(4) filtering that breaks the Path MTU Discovery mechanism. These interfaces natively support long frames for vlan: axe(4), bfe(4), cas(4), dc(4), et(4), fwe(4), fxp(4), gem(4), hme(4), le(4), nfe(4), rl(4), sf(4), sis(4), sk(4), ste(4), tl(4), tx(4), vr(4), vte(4), and xl(4). The vlan driver automatically recognizes devices that natively support long frames for vlan use and calculates the appropriate frame MTU based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, but they do not advertise this ability. The MTU setting on vlan can be corrected manually if used in conjunction with such a parent interface. SEE ALSO
ifconfig(8), sysctl(8) BUGS
No 802.1Q features except VLAN tagging are implemented. BSD
June 4, 2012 BSD
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy