If you would use CODE tags as required in this forum it would help with your spacing issues. That wouldn't, however, do anything about inconsistent capitalization. I think this does what you want, even though the output produced doesn't match any of the output you specified:
If you are using a Solaris/SunOS system, use /usr/xpg4/bin/awk or nawk instead of awk.
I have an output that I get from while read, I want to display it as the following, please help.
Original output from while read line loop:
This is my client=1
client version=2.3.4
OS version=4.5
This is my client=2
client version=1.5.6
OS version=6.7
I want it to look like this with... (7 Replies)
Hi Guys,
my $cmd = "ls -l"; #........ {or let it be as # my $cmd= "ls"; }
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd("$cmd");
print $stdout;
the script works fine, but i am unable to see the output getting displayed in a... (7 Replies)
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
hello all
i request you to give the solution for the following problem..
I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print
g
go
goo
goog
googl
google
like this Using unix Shell scripting...
without using... (1 Reply)
hello all
i request you to give the solution for the following problem..
I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print
g
go
goo
goog
googl
google
like this Using unix Shell scripting...
... (7 Replies)
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
need help to print the below ..
Content of file looks like below ..
SCHEMA1. TABLE1
SCHEMA2. TABLE2
SCHEMA3. TABLE3
read lines from above file and print o/p as below
print output like read 1st line and print
SELECT SCHEMA1.TABLE1
print output like read 2st line and print ... (4 Replies)
Hi All,
i am trying to print the solaris 11 packages in below required format, But i am unable to do that.
Current ouput :
root@abc# pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}'
NAME: QLogic 570x/571x Gigabit Ethernet Driver
VERSION: 11.11,REV=2009.11.11
... (7 Replies)
Discussion started by: balu1234
7 Replies
LEARN ABOUT HPUX
hba_getdiscoveredportattributes
HBA_GetAdapterPortAttributes(3HBAAPI) Common Fibre Channel HBA Information Library Functions HBA_GetAdapterPortAttributes(3HBAAPI)NAME
HBA_GetAdapterPortAttributes, HBA_GetDiscoveredPortAttributes, HBA_GetPortAttributesByWWN - retrieve Fibre Channel port attributes for a
specific device
SYNOPSIS
cc [ flag... ] file... -lHBAAPI [ library... ]
#include <hbaapi.h>
HBA_STATUS HBA_GetAdapterPortAttributes(HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTATTRIBUTES *portattributes);
HBA_STATUS HBA_GetDiscoveredPortAttributes(HBA_HANDLE handle, HBA_UINT32 portindex, HBA_UINT32 discoveredportindex, HBA_PORTATTRIBUTES
*portattributes);
HBA_STATUS HBA_GetPortAttributesByWWN(HBA_HANDLE handle, HBA_WWN PortWWN, HBA_PORTATTRIBUTES *portattributes);
PARAMETERS
handle an open handle returned from HBA_OpenAdapter(3HBAAPI)
portindex the index of a specific port on the HBA as returned by a call to HBA_GetAdapterAttributes(3HBAAPI).
The maximum value specified should be (HBA_ADAPTERATTRIBUTES.NumberOfPorts - 1).
portattributes a pointer to an HBA_PORTATTRIBUTES structure. Upon successful completion, this structure contains the specified port
attributes.
discoveredportinthe index of a specific discovered port on the HBA as returned by HBA_GetAdapterPortAttributes(3HBAAPI). The maximum value
specified should be (HBA_PORTATTRIBUTES.NumberOfDiscoveredPorts - 1).
PortWWN the port WWN of the device for which port attributes are retrieved.
DESCRIPTION
The HBA_GetAdapterPortAttributes() function retrieves Port Attributes for a specific port on the HBA.
The HBA_GetDiscoveredPortAttributes() function retrieves Port Attributes for a specific discovered device connected to the HBA.
The HBA_GetPortAttributesByWWN() function retrieves Port Attributes for a specific device based on the PortWWN argument.
RETURN VALUES
Upon successful completion, HBA_STATUS_OK is returned. Otherwise, an error value is returned from the underlying VSL and the values in
hbaattributes are undefined.
ERRORS
See libhbaapi(3LIB) for general error status values.
EXAMPLES
Example 1: Retrieve the port attributes for each port on the HBA.
The following example retrieves the port attributes for each port on the HBA.
for (hbaPort = 0; hbaPort < hbaAttrs.NumberOfPorts; hbaPort++) {
if ((status = HBA_GetAdapterPortAttributes(handle,
hbaPort, &hbaPortAttrs)) != HBA_STATUS_OK) {
fprintf(stderr, "Unable to get adapter port %d "
"attributes for HBA %d with name "%s".
",
hbaPort, hbaCount, adaptername);
HBA_CloseAdapter(handle);
continue;
}
memcpy(&wwn, hbaPortAttrs.PortWWN.wwn, sizeof (wwn));
printf(" Port %d: WWN=%016llx
", hbaPort, wwn);
/* ... */
}
Example 2: Retrieve the discovered port target attributes for each discovered target port on the HBA.
The following example retrieves the discovered port target attributes for each discovered target port on the HBA.
for (discPort = 0;
discPort < hbaPortAttrs.NumberofDiscoveredPorts;
discPort++) {
if ((status = HBA_GetDiscoveredPortAttributes(
handle, hbaPort, discPort,
&discPortAttrs)) != HBA_STATUS_OK) {
fprintf(stderr, "Unable to get "
"discovered port %d attributes for "
"HBA %d with name "%s".
",
discPort, hbaCount, adaptername);
continue;
}
memcpy(&wwn, discPortAttrs.PortWWN.wwn,
sizeof (wwn));
printf(" Discovered Port %d: WWN=%016llx
",
discPort, wwn);
/* ... */
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard: FC-MI 1.92 (API |
| |version 1) |
+-----------------------------+-----------------------------+
| |Standard: FC-HBA Version 4 |
| |(API version 2) |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO HBA_GetAdapterPortAttributes(3HBAAPI), HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5)
T11 FC-MI Specification
SunOS 5.10 1 Sep 2003 HBA_GetAdapterPortAttributes(3HBAAPI)