4 x fibre cards elimination


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting 4 x fibre cards elimination
# 1  
Old 11-28-2008
4 x fibre cards elimination

Hi,

I have variables like mentioned below and want to separate as mentioned in output.

var1="4 x fibre cards"
var2="2 fibre cards"
var3="6 - fibre cards"
var4="4 x dual-port"

I have variables like this.I want to separate numbers from this and fibre cards from this.

output has to be
4 fibre-cards
2 fibre-cards
6 fibre-cards
4 dual-port

Any one can help please...it would be great if any one can provide reply asap as it is very urgent.
# 2  
Old 11-28-2008
None over there to solve this??
# 3  
Old 11-28-2008
What about you?
Here is the kickstart:
Code:
var1=$(awk 'NF==3{printf "%s %s-%s",$1,$2,$3}NF==4{printf "%s %s-%s",$1,$3,$4}' <<< $var1)

# 4  
Old 11-28-2008
Hi,

try:

Code:
for i in ${!var*}; do sed "s/ [x-] / /g;s/ \(.*\) / \1-/" <<< "${!i}"; done

The output looks like this (on bash):

Code:
4 fibre-cards
2 fibre-cards
6 fibre-cards
4 dual-port

The script will search for all variables named var* and then do two simple
substitutions, delete occurances of " x" or " -" and join two separate
words by a hyphen. You should be able to modify this according to your
needs.

HTH Chris
# 5  
Old 11-28-2008
Thanks chirs..!!
Great...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

[ASK] - AIX Fibre Channel behavior

Hello all, Let me introduce about the context and my environment. We have an AIX 6.1 system, it has 4 FC channels / > lsdev -Cc adapter | grep fcs fcs0 Available 23-T1 Virtual Fibre Channel Client Adapter fcs1 Available 23-T1 Virtual Fibre Channel Client Adapter fcs2 Available 23-T1... (14 Replies)
Discussion started by: Phat
14 Replies

2. IP Networking

Squid connection to Fibre switch

Hello, Please note that we have squid and running properly on ADSL connection. We have upgraded the link to connect through our Fibre switch with a public static IP. How do we configure squid to connect through this static ip? Note when we connect it directly from fibre switch to our laptop -... (0 Replies)
Discussion started by: isoabv
0 Replies

3. AIX

VIOS - fibre adapters not seeing luns

Hi guys, I've been trying to tackle this issue for days and I'm stumped. Hopefully someone can give more light on what else I can do. I have a p7 series box, with dual VIOS and 10 lpars and everything was working fine until I had to move the box to another location in the data centre. Ensured... (16 Replies)
Discussion started by: aixkidbee
16 Replies

4. War Stories

How not to install fibre links between data centres!

Hi Folks, A couple of years ago we had to replace the core switches between two of our data centres, a simple task for the most part - these new switches would be state of the art Cisco Catalyst units. The link between the two sites was a dark fibre, with 8Gb bandwidth running full duplex... (9 Replies)
Discussion started by: gull04
9 Replies

5. Hardware

Fibre Channel HBA recommendations?

We will be buying new Xeon E5-based servers for our datacenter and were wondering which Fibre Channel host bus adapters we should select for these. The choices are Emulex or QLogic (8Gb FC HBAs). Anybody have any recommendations on which is the better choice? Thanks in advance. (1 Reply)
Discussion started by: atahmass
1 Replies

6. Shell Programming and Scripting

duplicate elimination with column print

hi, my input a b c d e f g k i m g i k l b i n g o h m a b c d e b i n g o my output a b c d e f g k i m g i k l b i n g o h m what I would like to do is compare the first five columns of each row to the entire records in the file and if there is a match, eliminate that... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

7. Shell Programming and Scripting

[ask]elimination with diskspace

dear all, i want elimination file with disk space for example: $ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 62G 19G 41G 31% / /dev/sda1 99M 13M 82M 13% /boot tmpfs 1014M 0... (2 Replies)
Discussion started by: zvtral
2 Replies

8. Shell Programming and Scripting

Date elimination

I have a file with the following data. I want to start writing lines out of this file to another file only after the time is greater than 20:00:00 hours and the first job is U1KC000. I would like to be able to run this out of a script and pass the time and job(U1KC000) as an argument. ... (14 Replies)
Discussion started by: wawa
14 Replies

9. AIX

Power6 Virtual Fibre Channel Adapter

Hello, Searched in all IBM Redbooks and on the internet and couldn't find anything about the new feature of POWER 6 which Virtual Fibre ( Fiber ) channel adapter. It is similar to virtual scsi adapter. In my client partition I created the virtual Fibre Adapter mapped it with the VIO... (1 Reply)
Discussion started by: filosophizer
1 Replies

10. AIX

Install Fibre Card AIX 5.3

Hello, I have two systems that are being prepared to be SAN attached .. can anyone tell me any specific checks I should perform prior to the cards being installed... I am aware of firmware / OS level and relevant drivers, is there anything else? thanks Chris. (8 Replies)
Discussion started by: chlawren
8 Replies
Login or Register to Ask a Question