I am trying to generate list of employees from emp table who joined yesterday.
emp.sh
emp.sql
I expected that when i do cat emp.sql in emp.sh, value of YEST will get replaced with 2011-02-15. But the query that is getting passed to mysql is select * from employee where join_date = '$YEST';
I can do sed to replace variable with value in sql file and then run the query. But is there any other easy way of doing it. Why cat done in emp.sh is not replacing the value?
hello, I must've screwed something here..
I just had hdisk0 replaced by IBM.. now it shows up as hdisk2 instead.
Before doing that, I've had it split from hdisk1, and reduced from rootvg.
Just did a rmdev -dl hdisk2.. ran cfgmgr, but still shows up as hdisk2 instead of hdisk0.. help! (2 Replies)
Hi All,
.profile has been replaced with a new one. I need to know the variables used in the older version of .profile. I have a session opened using the old .profile.
Is there a way that I can get the exact file.
I had some luck by using set command. But is there any way that I can get the... (5 Replies)
Hi All,
To avoid race condition, instead of using mutex, semaphore, spinlock etc.... Is there any other mechanism by which we can avoid race condition in an multi-threading environment.
-Thanks (6 Replies)
Source data:
"123","aaa bbb CCC","12000"
"134","HHH,bbc","13000"
i have a delimited file. i want to replace with the pipe.The sed command is not working for replacing a delimeter.
Command :
sed s/\,/\|/g filename
Output : When i run the command it is replacing the columns value... (7 Replies)
Hi,
I have a file with occurances of the string "TO_DATE(<number here>,'J')" at random places. I need minus 2400000 from the number and replace the string with "convert(date, dateadd(dd, <new number here>,'16 Nov 1858')".
I'm finding this difficult as the string isn't necessarily in the... (9 Replies)
Hi,
I`m on SunFire480R with Solaris 10. Disk in rootdg group failed, so it was replaced. However, I cannot make Veritas initalise the replaced disk:
# vxdctl enable
# vxdisk list c1t0d0s2
Device: c1t0d0s2
devicetag: c1t0d0
type: auto
flags: online error private autoconfig... (1 Reply)
My task is to copy all files from many directories in one. The big problem i encounter is that some files in different directory have the same names. Is they are way to copy the files that have same names in a sub directory ( need to preserve the name of the files unchanged )
I have list with... (6 Replies)
Hi,
a little while ago, one of the GPT Partitioned hard disk had gone faulty in a Mirror RAID and is now successfully replaced.
here is how I did that.
1) created identical partition table on the new disk.
2) attached the mirrors using md commands.
The whole procedure is given below:... (2 Replies)
hi, i am copying an xml file from windows to linux server using filezilla&winscp. xml file contains ¦¦ symbols, after copying xml file to server ¦¦ is replaced with <A6><A6>. tried with copying xml files from windows in ascii&binary but no luck.
please suggest.
thanks (1 Reply)
Discussion started by: Satyak
1 Replies
LEARN ABOUT BSD
insq
insq(9F) Kernel Functions for Drivers insq(9F)NAME
insq - insert a message into a queue
SYNOPSIS
#include <sys/stream.h>
int insq(queue_t *q, mblk_t *emp, mblk_t *nmp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Pointer to the queue containing message emp.
emp Enqueued message before which the new message is to be inserted. mblk_t is an instance of the msgb(9S) structure.
nmp Message to be inserted.
DESCRIPTION
insq() inserts a message into a queue. The message to be inserted, nmp, is placed in q immediately before the message emp. If emp is NULL,
the new message is placed at the end of the queue. The queue class of the new message is ignored. All flow control parameters are updated.
The service procedure is enabled unless QNOENB is set.
RETURN VALUES
insq() returns 1 on success, and 0 on failure.
CONTEXT
insq() can be called from user or interrupt context.
EXAMPLES
This routine illustrates the steps a transport provider may take to place expedited data ahead of normal data on a queue (assume all M_DATA
messages are converted into M_PROTO T_DATA_REQ messages). Normal T_DATA_REQ messages are just placed on the end of the queue (line 16).
However, expedited T_EXDATA_REQ messages are inserted before any normal messages already on the queue (line 25). If there are no normal
messages on the queue, bp will be NULL and we fall out of the for loop (line 21). insq acts like putq(9F) in this case.
1 #include
2 #include
3
4 static int
5 xxxwput(queue_t *q, mblk_t *mp)
6 {
7 union T_primitives *tp;
8 mblk_t *bp;
9 union T_primitives *ntp;
10
11 switch (mp->b_datap->db_type) {
12 case M_PROTO:
13 tp = (union T_primitives *)mp->b_rptr;
14 switch (tp->type) {
15 case T_DATA_REQ:
16 putq(q, mp);
17 break;
18
19 case T_EXDATA_REQ:
20 /* Insert code here to protect queue and message block */
21 for (bp = q->q_first; bp; bp = bp->b_next) {
22 if (bp->b_datap->db_type == M_PROTO) {
23 ntp = (union T_primitives *)bp->b_rptr;
24 if (ntp->type != T_EXDATA_REQ)
25 break;
26 }
27 }
28 (void)insq(q, bp, mp);
29 /* End of region that must be protected */
30 break;
. . .
31 }
32 }
33 }
When using insq(), you must ensure that the queue and the message block is not modified by another thread at the same time. You can achieve
this either by using STREAMS functions or by implementing your own locking.
SEE ALSO putq(9F), rmvq(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
WARNINGS
If emp is non-NULL, it must point to a message on q or a system panic could result.
SunOS 5.10 9 Jul 2001 insq(9F)