Sponsored Content
Top Forums Shell Programming and Scripting awk programming and sub function Post 83481 by cubs0729 on Thursday 15th of September 2005 09:31:29 AM
Old 09-15-2005
Nope

I just tried it but to no avail. I got the same error message.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk programming

Hi all, i want to study harder awk programming. where can i get a good examples, problems and solutions. i'm in a hurry.. thanks, (5 Replies)
Discussion started by: tungaw2004
5 Replies

2. Programming

setenv function in C programming

Hi I have a problem with setenv function in C. I'm calling an .exe of a c program from my shell script. Now, I have to pass a value from the .exe to my shell script. So i have exported an variable in my script. And in the C program I'm setting the variable as setenv("REC_CNT",rec_cnt,1); ... (7 Replies)
Discussion started by: janemary.a
7 Replies

3. Programming

connect() function in C++ socket programming

Hello All, I have a problem using connect(...) function in C++. I am using SSH from my windows system to connect it to linux server. The program works fine if I run it directly in Linux machine but I need it to run through windows machine. The function returns -1 and so my program terminates. ... (3 Replies)
Discussion started by: smdhd3
3 Replies

4. Programming

Please help! accept function problems in Socket programming

Hi, I have a client-server socket program. It has been working fine for over a year, but recently it started to show strange behavior.:confused: After the server program runs for a while, it will show in the top command saying it is using lots of CPU, MEM. I assume it means the server code is... (1 Reply)
Discussion started by: natxie
1 Replies

5. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

6. Programming

awk programming

I have the list of numbers in a file 105.1 102.0 100.5 100 98 97.5 95 ... I want to get how many times I have numbers greater than a particular limit, say 100 in the list. How can I do that with awk command? (5 Replies)
Discussion started by: pranto_d
5 Replies

7. Shell Programming and Scripting

AWK programming

Hi All, I read the AWK manual in the MAN page. But i didn't understand the below piece of code in the script TABLE=`echo "${FILE}" | awk -F"/" '{print $NF}' | cut -d"." -f1 | awk -F"_" '{print $NF}' 2>> ${LOGFILE}`; Please explain the above code. Thanks in advance ....... Regards,... (4 Replies)
Discussion started by: pdathu
4 Replies

8. Shell Programming and Scripting

awk programming

Need assistance using awk . Need assistance in awk programming. Any idea of getting the marked data into a file. </tr> <tr> <td class='labelOptional_ind'> cdr.00012325.0000000000000000.20130612.050005.WANP4722_csv </td> <td width='15%' class='labelOptional'> <div align='center'>... (8 Replies)
Discussion started by: ajayram_arya
8 Replies

9. Shell Programming and Scripting

awk programming -Passing variable to awk for loop

Hi All, I am new to AWK programming. I have the following for loop in my awk program. cat printhtml.awk: BEGIN -------- <some code here> END{ ----------<some code here> for(N=0; N<H; N++) { for(M=5; M<D; M++) print "\t" D ""; } ----- } ... (2 Replies)
Discussion started by: ctrld
2 Replies

10. Shell Programming and Scripting

Need help on awk for printing the function name inside each function

Hi, I am having script which contains many functions. Need to print each function name at the starting of the function. Like below, functionname() { echo "functionname" commands.... } I've tried like below, func=`grep "()" scriptname | cut -d "(" -f1` for i in $func do nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
allocb(9F)						   Kernel Functions for Drivers 						allocb(9F)

NAME
allocb - allocate a message block SYNOPSIS
#include <sys/stream.h> mblk_t *allocb(size_t size, uint_t pri); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). DESCRIPTION
allocb() tries to allocate a STREAMS message block. Buffer allocation fails only when the system is out of memory. If no buffer is avail- able, the bufcall(9F) function can help a module recover from an allocation failure. A STREAMS message block is composed of three structures. The first structure is a message block (mblk_t). See msgb(9S). The mblk_t struc- ture points to a data block structure (dblk_t). See datab(9S). Together these two structures describe the message type (if applicable) and the size and location of the third structure, the data buffer. The data buffer contains the data for this message block. The allocated data buffer is at least double-word aligned, so it can hold any C data structure. The fields in the mblk_t structure are initialized as follows: b_cont set to NULL b_rptr points to the beginning of the data buffer b_wptr points to the beginning of the data buffer b_datap points to the dblk_t structure The fields in the dblk_t structure are initialized as follows: db_base points to the first byte of the data buffer db_lim points to the last byte + 1 of the buffer db_type set to M_DATA The following figure identifies the data structure members that are affected when a message block is allocated. Please see the online man page on docs.sun.com or a print copy for the diagram. Figure that identifies the data structure members that are affected when a message block is allocated PARAMETERS
size The number of bytes in the message block. pri Priority of the request (no longer used). RETURN VALUES
Upon success, allocb() returns a pointer to the allocated message block of type M_DATA. On failure, allocb() returns a NULL pointer. CONTEXT
allocb() can be called from user or interrupt context. EXAMPLES
Example 1: allocb() Code Sample Given a pointer to a queue (q) and an error number (err), the send_error() routine sends an M_ERROR type message to the stream head. If a message cannot be allocated, NULL is returned, indicating an allocation failure (line 8). Otherwise, the message type is set to M_ERROR (line 10). Line 11 increments the write pointer (bp->b_wptr) by the size (one byte) of the data in the message. A message must be sent up the read side of the stream to arrive at the stream head. To determine whether q points to a read queue or to a write queue, the q->q_flag member is tested to see if QREADR is set (line 13). If it is not set, q points to a write queue, and in line 14 the RD(9F) function is used to find the corresponding read queue. In line 15, the putnext(9F) function is used to send the message upstream, returning 1 if successful. 1 send_error(q,err) 2 queue_t *q; 3 unsigned char err; 4 { 5 mblk_t *bp; 6 7 if ((bp = allocb(1, BPRI_HI)) == NULL) /* allocate msg. block */ 8 return(0); 9 10 bp->b_datap->db_type = M_ERROR; /* set msg type to M_ERROR */ 11 *bp->b_wptr++ = err; /* increment write pointer */ 12 13 if (!(q->q_flag & QREADR)) /* if not read queue */ 14 q = RD(q); /* get read queue */ 15 putnext(q,bp); /* send message upstream */ 16 return(1); 17 } SEE ALSO
RD(9F), bufcall(9F), esballoc(9F), esbbcall(9F), putnext(9F), testb(9F), datab(9S), msgb(9S) Writing Device Drivers STREAMS Programming Guide NOTES
The pri argument is no longer used, but is retained for compatibility with existing drivers. SunOS 5.10 22 March 2002 allocb(9F)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy