Sponsored Content
Top Forums Shell Programming and Scripting read in variable data from another file - grep Post 302268861 by vgersh99 on Tuesday 16th of December 2008 12:18:09 PM
Old 12-16-2008
is 'ec' the first field in all.inq?

Pls post a sample all.inq, a sample 1.lst and a desired output of 1.inq

And indicate a 'common' field between all.ina and 1.lst files
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read data from a file into a variable

I am a FORTRAN guy and not a UNIX expert by any means so sorry if this sounds dumb, but all I want to do is have a UNIX script which reads data from a file (say 1000 lines worth, each row is a file name) and store it in an array to perform an operation on later. As maddeningly simple as this... (2 Replies)
Discussion started by: yorkdg
2 Replies

2. Shell Programming and Scripting

Read from data file

Hi, I have a data file formatted like this: Ex: Mike 3434 Jack 481 Peter 12 Alan 926 I want to get this data into 2 variables: "Names" and "Numbers" that I can using one "for" loop to get the value as Names and Numbers Like this: for i in 0 1 2 3 do echo $Names echo... (12 Replies)
Discussion started by: fongthai
12 Replies

3. Shell Programming and Scripting

Post Shell programming: Question about source a file and read data from the file

This is shell programming assignment. It needs to create a file called .std_dbrc contains STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB (which includes all my simple database files) and I am gonna use this .std_dbrc in my script file (read the data from the database files) like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies

4. UNIX for Advanced & Expert Users

how to read the data from an excel sheet and use those data as variable in the unix c

I have 3 columns in an excel sheet. c1 c2 c3 EIP_ACCOUNT SMALL_TS_01 select A.* from acc; All the above 3 col shoud be passed a variable in the unix code. 1.How to read an excel file 2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies

5. Shell Programming and Scripting

Want to read data from a file name.txt and search it in another file and then matching...

Hi Frnds... I have an input file name.txt and another file named as source.. name.txt is having only one column and source is having around 25 columns...i need to read from name.txt line by line and search it in source file and then save the result in results file.. I have a rough idea about the... (15 Replies)
Discussion started by: ektubbe
15 Replies

6. Shell Programming and Scripting

Perl: How to read text from file and process $variable in that data too.

In the hello.htm have the sentenses: Hello $name How are you? The perl script: $name = "David"; open(HEADER,"hello.htm"); while(<HEADER>) { $html .= $_; } close(HEADER); print "$html";I making something about template. But it can't process the $name variable. (4 Replies)
Discussion started by: natong
4 Replies

7. Shell Programming and Scripting

How to read file and load data into a script as variable

I need to read a text file that contain columns of data, i need to read 1st column as a function to call, and others are the data i need to get into a ksh script. I am quite new to ksh scripting, i am not very sure how to read each row line by line and the data in each columns of that line, set... (3 Replies)
Discussion started by: gavin_L
3 Replies

8. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

9. Shell Programming and Scripting

How to read each file grep a value from that?

Hi Team, in /tmp folder i have thousands of log files i want to read each file and grep a value called "Calling This". Each logfile name is different but it ends with .log. How can i achieve this? Please excuse if i did any mistake by not following forum standards. I will surely follow... (10 Replies)
Discussion started by: darling
10 Replies

10. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
HBA_SendScsiInquiry(3HBAAPI)		      Common Fibre Channel HBA Information Library Functions		      HBA_SendScsiInquiry(3HBAAPI)

NAME
HBA_SendScsiInquiry, HBA_ScsiInquiryV2, HBA_SendReportLUNs, HBA_ScsiReportLUNsV2, HBA_SendReadCapacity, HBA_ScsiReadCapacityV2 - gather SCSI information from discovered ports SYNOPSIS
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_SendScsiInquiry(HBA_HANDLE handle, HBA_WWN PortWWN, HBA_UINT64 fcLUN, HBA_UINT8 EVPD, HBA_UINT32 PageCode, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize); HBA_STATUS HBA_ScsiInquiryV2(HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, HBA_UINT8 CDB_BYTE1, HBA_UINT8 CDB_BYTE2, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize); HBA_STATUS HBA_SendReportLUNs(HBA_HANDLE handle, HBA_WWN PortWWN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize); HBA_STATUS HBA_ScsiReportLUNsV2(HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize); HBA_STATUS HBA_SendReadCapacity(HBA_HANDLE handle, HBA_WWN PortWWN, HBA_UINT64 fcLUN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize); HBA_STATUS HBA_ScsiReadCapacityV2(HBA_HANDLE handle HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize); PARAMETERS
handle an open handle returned from HBA_OpenAdapter(3HBAAPI) PortWWN the port WWN of the discovered remote device to which the command is sent hbaPortWWN HBA_ScsiInquiryV2() the Port WWN of the local HBA through which the SCSI INQUIRY command is issued HBA_ScsiReportLUNsV2() the Port WWN of the local HBA through which the SCSI REPORT LUNS command is issued HBA_ScsiReadCapacityV2() the Port WWN of a local HBA through which the SCSI READ CAPACITY command is issued discoveredPortWWN HBA_ScsiInquiryV2() the Remote Port WWN to which the SCSI INQUIRY command is being sent HBA_ScsiReportLUNsV2() the Remote Port WWN to which the SCSI REPORT LUNS command is sent HBA_ScsiReadCapacityV2() the Remote Port WWN to which the SCSI READ CAPACITY command is sent fcLUN the FCP LUN as defined in the T10 specification SAM-2 to which the command is sent EVPD If set to 0, indicates a Standard Inquiry should be returned. If set to 1, indicates Vital Product Data should be returned. PageCode If EVPD is set to 1, PageCode indicates which Vital Product Data page should be returned. CDB_Byte1 the second byte of the CDB for the SCSI INQUIRY command CDB_Byte2 the third byte of the CDB for the SCSI INQUIRY command pRspBuffer a buffer in which to store the response payload RspBufferSize the size of the response buffer pRspBufferSize a pointer to the size of the response buffer pScsiStatus a buffer to receive SCSI sense data pSenseBuffer a buffer in which to store any SCSI sense data SenseBufferSize the size of the sense buffer pSenseBufferSize a pointer to the size of the sense buffer DESCRIPTION
The HBA_SendScsiInquiry() and HBA_SendScsiInquiryV2() functions send a SCSI Inquiry command as defined in the T10 specification SPC-2 to a remote FCP port. The HBA_SendReportLUNs() and HBA_SendReportLUNsV2() functions send a SCSI Report LUNs command as defined in the T10 specification SPC-2 to a remote FCP port. The HBA_SendReadCapacity() and HBA_SendReadCapacityV2() functions end a SCSI Read Capacity command as defined in the T10 specification SBC-2 to a remote FCP port. RETURN VALUES
The HBA_SendScsiInquiry() function returns the following value: HBA_STATUS_OK The command has completed. Success or failure should be determined by verifying that the sense data does not contain a check-condition. If a check-condition is present, the content of pRspBuffer is undefined. The HBA_ScsiInquiryV2() function returns the following values: HBA_STATUS_OK The command has completed. The complete payload of the SCSI INQUIRY command is returned in pRspBuffer. HBA_STATUS_ERROR_ILLEGAL_WWN The port WWN hbaPortWWN is not a WWN contained by the HBA specified by handle. HBA_STATUS_ERROR_NOT_A_TARGET The identified remote Port does not have SCSI Target functionality. HBA_STATUS_ERROR_TARGET_BUSY The command cannot be sent due to a SCSI overlapped command condition. HBA_STATUS_ERROR An error occurred. The HBA_SendReportLUNs() function returns the following values: HBA_STATUS_OK The command has completed. Success or failure should be determined by verifying the sense data does not contain a check-condition. If a check-condition is present, the content of pRspBuffer is undefined. HBA_STATUS_SCSI_CHECK_CONDITION The HBA detected a check-condition state. Details are present in the pSenseBuffer payload. The content of pRspBuffer is undefined. Not all VSLs support this error condition. Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data. The HBA_SendReportLUNsV2() function returns the following values: HBA_STATUS_OK The command has completed. Sense data must be verified to ensure that it does not contain a check-condition to determine success. If a check-condition is present, the content of pRspBuffer is undefined. HBA_STATUS_ERROR_ILLEGAL_WWN The port WWN hbaPortWWN is not a WWN contained by the HBA specified by handle. HBA_STATUS_ERROR_NOT_A_TARGET The identified remote Port does not have SCSI Target functionality. HBA_STATUS_ERROR_TARGET_BUSY The command cannot be sent due to a SCSI overlapped command condition. HBA_STATUS_ERROR An error occurred. The HBA_SendReadCapacity() function returns the following values: HBA_STATUS_OK The command has completed. Success or failure should be determined by verifying that the sense data does not contain a check-condition. If a check-condition is present, the content of pRspBuffer is undefined. HBA_STATUS_SCSI_CHECK_CONDITION The HBA detected a check-condition state. Details are present in the pSenseBuffer payload. The content of pRspBuffer is undefined. Not all VSLs support this error condition. Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data. The HBA_ScsiReadCapacityV2() function returns the following values: HBA_STATUS_OK The command has completed. Sense data must be verified to ensure that it does not contain a check-condition to determine success. If a check-condition is present, the content of pRspBuffer is undefined. HBA_STATUS_ERROR_ILLEGAL_WWN The port WWN hbaPortWWN is not a WWN contained by the HBA specified by handle. HBA_STATUS_ERROR_NOT_A_TARGET The identified remote Port does not have SCSI Target functionality. HBA_STATUS_ERROR_TARGET_BUSY The command cannot be sent due to a SCSI overlapped command condition. HBA_STATUS_ERROR An error occurred. Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data. ERRORS
See libhbaapi(3LIB) for general error status values. EXAMPLES
Example 1 Send a SCSI inquiry to the given discovered Target port WWN. The following example sends a SCSI inquiry to the given discovered Target port WWN. memset(&inq, 0, sizeof (inq)); memset(&sense, 0, sizeof (sense)); if ((status = HBA_SendScsiInquiry(handle, discPortAttrs.PortWWN, 0, 0, 0, &inq, sizeof (inq), &sense, sizeof (sense))) != HBA_STATUS_OK) { fprintf(stderr, "Unable to send SCSI " "inquiry, reason %d ", status); continue; } printf(" Vendor: %.*s ", 8, inq.inq_vid); printf(" Model: %.*s ", 16, inq.inq_pid); 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 ver- | | |sion 2) | +-----------------------------+-------------------------------------+ |MT-Level |Safe | +-----------------------------+-------------------------------------+ SEE ALSO
HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5) T11 FC-MI Specification BUGS
The HBA_SendScsiInquiry(), HBA_SendReportLUNs(), and HBA_SendReadCapacity() functions do not take a portindex to define through which port of a multi-ported HBA the command should be sent. The behavior on multi-ported HBAs is vendor-specific and can result in the command being sent through the first HBA port, the first HBA port the given PortWWN is connected to, or other vendor-specific behavior. SNIA version 2 defines HBA_ScsiInquiryV2(), HBA_ScsiReportLUNs(), and HBA_ScsiReadCapacity() to take a Port WWN as an argument. This fixes the bug with multi-ported HBAs in HBA_ScsiInquiry(), HBA_SendReportLUNs(), and HBA_SendReadCapacity(). SunOS 5.11 1 Sep 2003 HBA_SendScsiInquiry(3HBAAPI)
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy