Sponsored Content
Full Discussion: valor of variable
Top Forums Shell Programming and Scripting valor of variable Post 302429221 by uri_crack on Sunday 13th of June 2010 02:24:07 PM
Old 06-13-2010
valor of variable

I have this line an script:

Code:
awk-v cntr = 0 '/ Barcelona / (cntr + +) (print> "' $ nom '" cntr. "txt")' $ nom.txt

when you just do everything I want to know how much the variable cntr, as I can do?

thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

2. Shell Programming and Scripting

Sed variable substitution when variable constructed of a directory path

Hello, i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem. my var1 is a string constructed like this: filename1 filerev1 filepath1 my var2 is another string constructed like this: filename2 filerev2 filepath2 when i do... (2 Replies)
Discussion started by: alrinno
2 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

5. Shell Programming and Scripting

Split variable length and variable format CSV file

Dear all, I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file. The file length will depend on the numbers of Earnings/Deductions/Direct Deposits. And The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies

6. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

7. Shell Programming and Scripting

Variable not found error for a variable which is returned from stored procedure

can anyone please help me with this: i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure... ... (4 Replies)
Discussion started by: swap21783
4 Replies

8. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

9. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
HBA_SendCTPassThru(3HBAAPI)		      Common Fibre Channel HBA Information Library Functions		       HBA_SendCTPassThru(3HBAAPI)

NAME
HBA_SendCTPassThru, HBA_SendCTPassThruV2 - end a Fibre Channel Common Transport request to a Fabric SYNOPSIS
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_SendCTPassThru(HBA_HANDLE handle, void *pReqBuffer, HBA_UINT32 ReqBufferSize, void *pRspBuffer, HBA_UINT32 RspBufferSize); HBA_STATUS HBA_SendCTPassThruV2(HBA_HANDLE handle, HBA_WWN hbaPortWWN, void *pReqBuffer, HBA_UINT32 ReqBufferSize, void *pRspBuffer, HBA_UINT32 *RspBufferSize); PARAMETERS
handle an open handle returned from HBA_OpenAdapter(3HBAAPI) hbaPortWWN the Port Name of the local HBA Port through which the caller is issuing the CT request pReqBuffer a pointer to a CT_IU request. The contents of the buffer must be in big-endian byte order ReqBufferSize the length of the CT_IU request buffer pReqBuffer pRspBuffer a pointer to a CT_IU response buffer. The response received from the fabric is copied into this buffer in big-endian byte order. Success of the function need not imply success of the command. The CT_IU Command/Response field should be checked for the Accept Response code. RspBufferSize HBA_SendCTPassThru() the length of the CT_IU accept response buffer pRspBuffer. HBA_SendCTPassThruV2() a Pointer to the length of the CT_IU accept response buffer pRspBuffer. DESCRIPTION
The HBA_SendCTPassThru() and HBA_SendCTPassThruV2() functions provide access to the standard in-band fabric management interface. The pRe- qBuffer argument is interpreted as a CT_IU request, as defined by the T11 specification FC-GS-3, and is routed in the fabric based on the GS_TYPE field. RETURN VALUES
Upon successful transport and receipt of a CT_IU response, HBA_SendCTPassThru() returns HBA_STATUS_OK. The CT_IU payload indicates whether the command was accepted by the fabric based on the Command/Response code returned. Otherwise, an error value is returned from the under- lying VSL and the values in pRspBuffer are undefined. Upon successful transport and receipt of a CT_IU response, HBA_SendCTPassThruV2() returns HBA_STATUS_OK. The CT_IU payload indicates whether the command was accepted by the fabric based on the Command/Response code returned. Otherwise, an error code is returned from the underlying VSL, and the values in pRspBuffer are undefined. The HBA_SendCTPassThruV2() function returns the following values: HBA_STATUS_ERROR_ILLEGAL_WWN The value of hbaPortWWN is not a valid port WWN on the specified HBA. HBA_STATUS_ERROR An error occurred. ERRORS
See libhbaapi(3LIB) for general error status values. EXAMPLES
Example 1 Data structures for the GIEL command. struct ct_iu_preamble { uint32_t ct_rev : 8, ct_inid : 24; uint32_t ct_fcstype : 8, ct_fcssubtype : 8, ct_options : 8, ct_reserved1 : 8; uint32_t ct_cmdrsp : 16, ct_aiusize : 16; uint32_t ct_reserved2 : 8, ct_reason : 8, ct_expln : 8, ct_vendor : 8; }; struct gs_ms_ic_elem { uchar_t elem_name[8]; uint32_t reserved1 : 24, elem_type : 8; }; struct gs_ms_giel_rsp { struct ct_iu_preamble ct_header; uint32_t num_elems; struct gs_ms_ic_elem elem_list[1]; }; #define MAX_PAYLOAD_LEN 65536 /* 64K */ Example 2 Send an GIEL Management Service command through the given HBA handle. The following example sends an GIEL Management Service command through the given HBA handle. req.ct_rev = 0x01; req.ct_fcstype = 0xFA; /* Management Service */ req.ct_fcssubtype = 0x01; /* Config server */ req.ct_cmdrsp = 0x0101; /* GIEL command */ req.ct_aiusize = MAX_PAYLOAD_LEN / 4 - sizeof (struct ct_iu_preamble) / 4; if ((status = HBA_SendCTPassThru(handle, &req, sizeof (req), rsp, MAX_PAYLOAD_LEN)) != HBA_STATUS_OK) { fprintf(stderr, "Unable to issue CT command on " for reason %d0, adaptername, status); } else { giel = (struct gs_ms_giel_rsp *)rsp; if (giel->ct_header.ct_cmdrsp != 0x8002) { fprintf(stderr, "CT command rejected on HBA " " } else { for (cntr = 0; cntr < giel->num_elems; cntr++) { memcpy(&wwn, giel->elem_list[cntr].elem_name, 8); printf(" Fabric element name: %016llx0, 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 ver- | | |sion 2) | +-----------------------------+-------------------------------------+ |MT-Level |Safe | +-----------------------------+-------------------------------------+ SEE ALSO
HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5) T11 FC-MI Specification BUGS
The HBA_SendCTPassThru() function does not take a portindex to define through which port of a multi-ported HBA to send the command. The behavior on multi-ported HBAs is vendor specific, and can result in the command always being sent on port 0 of the HBA. SNIA version 2 defines HBA_SendCTPassThruV2() which takes a Port WWN as an argument. This fixes the bug with multi-ported HBAs in HBA_SendCTPassThru(). SunOS 5.11 1 Sep 2003 HBA_SendCTPassThru(3HBAAPI)
All times are GMT -4. The time now is 12:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy