Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Putting echoed text into a new file Post 302280855 by likelylad on Tuesday 27th of January 2009 05:04:01 PM
Old 01-27-2009
thanks!

so if I had several lines of echoed text, I'd put that after after line? Or after the whole block?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

putting restrictions when copying file

I would like to create a command to copy a file with a restriction- if the file exists at the copy destination, the copy does not occur and message is provided that file already exists. (3 Replies)
Discussion started by: thoffpauir
3 Replies

2. UNIX for Dummies Questions & Answers

putting a timestamp in a file

I was sure there was a way to put a timestamp ina logfile but I can't seem to figure out how. What I would like to do is after the last messages in the rptmgr.err log is put a timestamp so I know the next time I look whats new. I am using AIX 5.1 any help will great Thanks (2 Replies)
Discussion started by: rocker40
2 Replies

3. Shell Programming and Scripting

echoed prompt not appearing until after read command.

I have a script I am runing on a hacked CDLinux live CD called from /etc/rc.d/rc.local. The part of th script in question goes like this. When run from rc.local the prompt "Centre name :" and the colour change does not appear until after I type the input text and press return. Also, I... (2 Replies)
Discussion started by: simonb
2 Replies

4. Shell Programming and Scripting

Putting screen output in a log file

I want to output screen messages to a logfile when executing an automated script. I have tried the script and command to do this but with no luck. Thanks, Nicole (5 Replies)
Discussion started by: nsutti
5 Replies

5. Shell Programming and Scripting

Capturing text & putting it in different variables

Dear friends, I have following text in a variable. /backup/rem1/10122010/res From this value of variable i want to take each text in different variables e.g. a=backup b=rem1 c=10122010 d=res please guide me to do so. Thank you in advance Anushree (5 Replies)
Discussion started by: anushree.a
5 Replies

6. Shell Programming and Scripting

Putting together all values from different files in one file

Hi All, This is what I am trying to achieve but to no avail. I have three sets of files which are: 1. One big dictionary file which looks like this: apple orange computer pear country 2. Some thousands of text files which are named as 1.dat, 2.dat, 3.dat etc The text files... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

7. Shell Programming and Scripting

execution of a string being echoed in bash

hi all, I am trying to do a loop on a series of plotting function shown below: colorlist=(blue red green); n=0; for k in $xy; do psbasemap $range -JM$scale -B10g5 -X1 -Y1 -P -K > $outfile pscoast $range -JM$scale -B10g5 -D$res -P -W$lwidth -G$fill -O -K >> $outfile echo... (1 Reply)
Discussion started by: ida1215
1 Replies

8. Programming

PHP Echoed in Ajax

I have built a site in PHP for radio station, and the daily schedule is displayed dynamically using PHP script. I have added links to view different days but when it loads up its just loading up a new page. I can't quite remember how I done it but I'd like it to be in ajax if that's... (2 Replies)
Discussion started by: AimyThomas
2 Replies

9. Shell Programming and Scripting

Putting a separator in file using awk/bash

I have a file with the following content: a-123-345-232 a-23343-4545-545 a-67676-45454-8787 a-129-8912-9824 b-564-78678-2322 b-5454-76767-8899 b-85554-124-152-29 c-34534-654543-323 (... and so on, actually these are pretty huge records) Now, I want that the file should not be broken in to... (8 Replies)
Discussion started by: askerbis
8 Replies

10. Shell Programming and Scripting

Need help in sorting the file and putting to a different folder

Hi, I am new to unix. Kindly help me on this. My requirement is as below: I have a path temp/input , temp/CL and temp/CM I have files in temp/input as below (dates in YYYYMMDDHHMISS) NMP1515O.CL.20181026111213 NMP1515O.CM.20181025111213 ... (4 Replies)
Discussion started by: Shanmugapriya D
4 Replies
dupb(9F)						   Kernel Functions for Drivers 						  dupb(9F)

NAME
dupb - duplicate a message block descriptor SYNOPSIS
#include <sys/stream.h> mblk_t *dupb(mblk_t *bp); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). DESCRIPTION
dupb() creates a new mblk_t structure (see msgb(9S)) to reference the message block pointed to by bp. Unlike copyb(9F), dupb() does not copy the information in the dblk_t structure (see datab(9S)), but creates a new mblk_t structure to point to it. The reference count in the dblk_t structure (db_ref) is incremented. The new mblk_t structure contains the same information as the original. Note that b_rptrand b_wptr are copied from the bp. Printed copy or docs.sun.com shows a figure that shows a new mblk_t structure created, with the original and new bp both pointing to the dblk_t structure, and db_ref incremented by one PARAMETERS
bp Pointer to the message block to be duplicated. mblk_t is an instance of the msgb(9S) structure. RETURN VALUES
If successful, dupb() returns a pointer to the new message block. A NULL pointer is returned if dupb() cannot allocate a new message block descriptor or if the db_ref field of the data block structure (see datab(9S)) has reached a maximum value(255). CONTEXT
dupb() can be called from user, kernel, or interrupt context. EXAMPLES
Example 1 Using dupb() This srv(9E) (service) routine adds a header to all M_DATA messages before passing them along. dupb is used instead of copyb(9F) because the contents of the header block are not changed. For each message on the queue, if it is a priority message, pass it along immediately (lines 10-11). Otherwise, if it is anything other than an M_DATA message (line 12), and if it can be sent along (line 13), then do so (line 14). Otherwise, put the message back on the queue and return (lines 16-17). For all M_DATA messages, first check to see if the stream is flow-controlled (line 20). If it is, put the message back on the queue and return (lines 37-38). If it is not, the header block is duplicated (line 21). dupb() can fail either due to lack of resources or because the message block has already been duplicated 255 times. In order to handle the latter case, the example calls copyb(9F) (line 22). If copyb(9F) fails, it is due to buffer allocation failure. In this case, qbuf- call(9F) is used to initiate a callback (lines 30-31) if one is not already pending (lines 26-27). The callback function, xxxcallback(), clears the recorded qbufcall(9F) callback id and schedules the service procedure (lines 49-50). Note that the close routine, xxxclose(), must cancel any outstanding qbufcall(9F) callback requests (lines 58-59). If dupb() or copyb(9F) succeed, link the M_DATA message to the new message block (line 34) and pass it along (line 35). 1 xxxsrv(q) 2 queue_t *q; 3 { 4 struct xx *xx = (struct xx *)q->q_ptr; 5 mblk_t *mp; 6 mblk_t *bp; 7 extern mblk_t *hdr; 8 9 while ((mp = getq(q)) != NULL) { 10 if (mp->b_datap->db_type >= QPCTL) { 11 putnext(q, mp); 12 } else if (mp->b_datap->db_type != M_DATA) { 13 if (canputnext(q)) 14 putnext(q, mp); 15 else { 16 putbq(q, mp); 17 return; 18 } 19 } else { /* M_DATA */ 20 if (canputnext(q)) { 21 if ((bp = dupb(hdr)) == NULL) 22 bp = copyb(hdr); 23 if (bp == NULL) { 24 size_t size = msgdsize(mp); 25 putbq(q, mp); 26 if (xx->xx_qbufcall_id) { 27 /* qbufcall pending */ 28 return; 29 } 30 xx->xx_qbufcall_id = qbufcall(q, size, 31 BPRI_MED, xxxcallback, (intptr_t)q); 32 return; 33 } 34 linkb(bp, mp); 35 putnext(q, bp); 36 } else { 37 putbq(q, mp); 38 return; 39 } 40 } 41 } 42 } 43 void 44 xxxcallback(q) 45 queue_t *q; 46 { 47 struct xx *xx = (struct xx *)q->q_ptr; 48 49 xx->xx_qbufcall_id = 0; 50 qenable(q); 51 } 52 xxxclose(q, cflag, crp) 53 queue_t *q; 54 int cflag; 55 cred_t *crp; 56 { 57 struct xx *xx = (struct xx *)q->q_ptr; ... 58 if (xx->xx_qbufcall_id) 59 qunbufcall(q, xx->xx_qbufcall_id); ... 60 } SEE ALSO
srv(9E), copyb(9F), qbufcall(9F), datab(9S), msgb(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.11 22 Mar 2002 dupb(9F)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy