Sponsored Content
Top Forums Shell Programming and Scripting writing shell script to find line of invalid characters Post 302298541 by daptal on Tuesday 17th of March 2009 11:20:40 PM
Old 03-18-2009
#!/usr/bin/sh;
cntr=1;
while read myline
do
cntr=`expr $cntr + 1`;
if [ `echo $myline | egrep '[a-z]'` ]; then
echo $cntr;
fi
done < txt

Here i am matching for the lines which contains a-z . Alter ur script accordingly

Cheers
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with shell script...ORA-00904:invalid identifier

Guys, Please suggest me what's wrong with this script? #!/usr/bin/sh ############################################################################## # Author : Bhagat Singh # # # Date : Nov 13,2006 #... (12 Replies)
Discussion started by: bhagat.singh-j
12 Replies

2. Shell Programming and Scripting

Shell Script Menus - Rejecting invalid input (KSH)

Greetings all, I'm currently writing a shell script menu which is dynamically populated from an array. Have a question to ask about the filtering of invalid input. I'm using KSH. A brief description of my algorithm is as follows: 1) Read in input from user and store in a variable. (a valid... (2 Replies)
Discussion started by: rockysfr
2 Replies

3. Shell Programming and Scripting

shell script to find and replace a line using a identifier

Hi all im having trouble starting with a shell script, i hope someone here can help me i have 2 files file1: 404905.jpg 516167 404906.jpg 516168 404917.psd 516183 404947.pdf 516250 file2: 516250 /tmp/RecyclePoster18241.pdf 516167 /tmp/ReunionCardFINAL.jpg 516168... (7 Replies)
Discussion started by: kenray
7 Replies

4. UNIX for Dummies Questions & Answers

shell script to find noof characters in a file name

hiiii shell script to find noof characters in a file name, when you run ls -l (using awk) I tried with this ls -l > temp awk -F"," '{print $1 " " expr length $9}' temp but it give some other value instead of file name length (error value like , 563,54,55,56....).How to prnint the... (10 Replies)
Discussion started by: krishnampkkm
10 Replies

5. Shell Programming and Scripting

Single/Multiple Line with Special characters - Find & Replace in Unix Script

Hi, I am creating a script to do a find and replace single/multiple lines in a file with any number of lines. I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE print $FIND gives Hi How r $u Rahul() Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies

6. Shell Programming and Scripting

How to find invalid URL in a text file using shell script?

How to find and remove invalid URLs in a text file using shell script? (1 Reply)
Discussion started by: vel4ever
1 Replies

7. UNIX for Dummies Questions & Answers

Invalid option errors running shell script

The script below fails with the following error messages: gzip: invalid option -- 'w' Try `gzip --help' for more information. mysqldump: Got errno 32 on write cp: invalid option -- 'w' Try `cp --help' for more information. rm: invalid option -- 'w' Try `rm --help' for more information. ... (1 Reply)
Discussion started by: ANNACTION
1 Replies

8. Shell Programming and Scripting

Need some help writing a find script

hello all! well, here is my problem: i have to write a script which waits for a directory as an argument and scans it recuresively and than it prints those files, which have write permission for everyone (as relative path from the argument directory so the find will be the key). and it shouldnt... (9 Replies)
Discussion started by: Mixe3y
9 Replies

9. Shell Programming and Scripting

Find new line characters in a file

Hi All, I need to find new line characters in a file and their location in the file and print the results. can someone pleas help. KM (4 Replies)
Discussion started by: Kevin Tivoli
4 Replies

10. Shell Programming and Scripting

Shell Script to find common lines and replace next line

I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb... (4 Replies)
Discussion started by: madira
4 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 10:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy