Sponsored Content
Top Forums Shell Programming and Scripting How to insert a char in every two? Post 302355078 by h8mmer on Monday 21st of September 2009 11:29:00 AM
Old 09-21-2009
How to insert a char in every two?

Hi,

I've written a script to interrogate all fibre devices on our systems and output the WWNs to a file. I now want to insert a ":" every 2 characters into the WWN so I can write another script to create aliases within the SAN.

So the current file has WWNs in the following format;
10000000C988CBE0

And I need them to look like;
10:00:00:00:C9:88:CB:E0

I'm head scratching so all help appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unable to insert '#' char for a file in vi mode

Hi all, I am very new to this forum and also new to UNIX. I am working on HP-UX machine. I noticed that for some of the users I am unable to insert the # character in a file in vi mode. May I know y am I having the problem and how can I resolve this Thanks, Maroli (1 Reply)
Discussion started by: maroli
1 Replies

2. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

3. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

4. Programming

concat const char * with char *

hello everybody! i have aproblem! i dont know how to concatenate const char* with char const char *buffer; char *b; sprintf(b,"result.txt"); strcat(buffer,b); thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies

5. Shell Programming and Scripting

how first char in odd line and second char in even line

Hi I m having ifconfig -a o/p like sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}' lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies

6. UNIX for Dummies Questions & Answers

Check if last char in a line is '.' and if not, insert it

Hi all, I've searched for this but couldn't seem to find the answer I'm looking for. I have a text file that looks like this: sgea0447 Earnings followed the same path. earnings followed the same path sgea0448 Economic growth slowed further. economic growth slowed further... (13 Replies)
Discussion started by: pxalpine
13 Replies

7. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

8. Shell Programming and Scripting

Insert carriage return on the 10th char position of each line

Hi experts, Need your help on how to insert carriage return after the 10th char position of each line in a file and then add two blank spaces after the carriage return. Example: >cat test.txt testingline dummystring samplesample teststringline Expected output should be.. ... (2 Replies)
Discussion started by: brichigo
2 Replies

9. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies

10. Shell Programming and Scripting

Search a certain char and insert new text if a match found

Have a file which has the create statement like below create table emp ( empno integer, empname char(50)) primary index(empno); i need to find a string starting with create and ends with semi-colon ;. if so insert the below statement before create statement rename table emp to emp_rename;... (2 Replies)
Discussion started by: Mohan0509
2 Replies
fp(7d)								      Devices								    fp(7d)

NAME
fp - Sun Fibre Channel port driver DESCRIPTION
The fp driver is a Sun fibre channel nexus driver that enables fibre channel topology discovery, device discovery, fibre channel adapter port management and other capabilities through well-defined fibre channel adapter driver interfaces. The fp driver requires the presence of a fabric name server in fabric and public loop topologies to discover fibre channel devices. In pri- vate loop topologies, the driver discovers devices by performing PLOGI to all valid AL_PAs, provided that devices do not participate in LIRP and LILP stages of loop initialization. CONFIGURATION
The fp driver is configured by defining properties in the fp.conf file. The fp driver supports the following properties: mpxio-disable Solaris I/O multipathing is enabled or disabled on fibre channel devices with the mpxio-disable property. Specifying mpxio-disable="no" activates I/O multipathing, while mpxio-disable="yes" disables the feature. Solaris I/O multipathing may be enabled or disabled on a per port basis. Per port settings override the global setting for the specified ports. The following example shows how to disable multipathing on port 0 whose parent is /pci@8,600000/SUNW,qlc@4: name="fp" parent="/pci@8,600000/SUNW,qlc@4" port=0 mpxio-disable="yes"; manual_configuration_only Automatic configuration of SCSI devices in the fabric is enabled by default and thus allows all devices discovered in the SAN zone to be enumerated in the kernel's device tree automatically. The manual_configuration_only property may be configured to disable the default behavior and force the manual configuration of the devices in the SAN. Specifying manual_configuration_only=1 disables the automatic con- figuration of devices. FILES
/kernel/drv/fp 32-bit ELF kernel driver (x86) /kernel/drv/amd64/fp 64-bit ELF kernel driver (x86) /kernel/drv/sparcv9/fp 64-bit ELF kernel driver (SPARC) /kernel/drv/fp.conf fp driver configuration file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |mpxio-disable |Unstable | +-----------------------------+-----------------------------+ |manual_configuration_only |Obsolete | +-----------------------------+-----------------------------+ |Availability |SUNWfctl | +-----------------------------+-----------------------------+ SEE ALSO
cfgadm_fp(1M), prtconf(1M), stmsboot(1M), driver.conf(4), attributes(5), fcp(7D), fctl(7D), scsi_vhci(7D) Writing Device Drivers Fibre Channel Physical and Signaling Interface (FC-PH) ANSI X3.230: 1994 Fibre Channel Generic Services (FC-GS-2) Project 1134-D Fibre Channel Arbitrated Loop (FC-AL) ANSI X3.272-1996 Fibre Channel Protocol for SCSI (FCP) ANSI X3.269-1996 SCSI-3 Architecture Model (SAM) Fibre Channel Private Loop SCSI Direct Attach (FC-PLDA) ANSI X3.270-1996 SCSI Direct Attach (FC-PLDA) ANSI X3.270-1996 SCSI Direct Attach (FC-PLDA) NCITS TR-19:1998 Fabric Loop Attachment (FC-FLA), NCITS TR-20:1998 SunOS 5.10 2 Dec 2004 fp(7d)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy