12-13-2011
display correctly variables with a \
Hi,
We are in AIX 5.3
In a shell program I use a variable coming from a file and containing a path : 'C:\temp\titi'
Z2='C:\temp\titi'
echo $Z2
When I want to print the variable with echo command , I have :
C: emp iti
How to have the correct variable ? Thanks
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi there,
What I am trying to do is export the same screen to 2 different machines at once.
I know you can use:
DISPLAY=IP:0.0
export DISPLAY
to send a screen to one machine but is there a way to send the screen to two machines at once by a similiar (or completely different, for that... (3 Replies)
Discussion started by: QUartz Ite
3 Replies
2. UNIX for Dummies Questions & Answers
I am an intern at a company with an HP visualize C160 running HP-UX B.10.20. It has stopped booting to the gui and, after some coaxing, will end up at a text-based menu screen but virtually nothing can be run from there.
At first the computer ran through it's boot process then stopped at this... (5 Replies)
Discussion started by: intern
5 Replies
3. HP-UX
i've same failure too, but this command boot pri isl
not work/not found
Thanks! (1 Reply)
Discussion started by: pantas manik
1 Replies
4. Shell Programming and Scripting
Anyone have an idea why this if statement does not work correctly?
"test2.sh" 18 lines, 386 characters
#!/usr/bin/sh
WARNING=80
CRITICAL=95
check_it()
{
if ] || ];then
echo "YES ] || ]"
else
echo "NO ] || ]"
fi
}
check_it 80.1
check_it 81.1 (3 Replies)
Discussion started by: 2dumb
3 Replies
5. Shell Programming and Scripting
My goal is to find files contain the "signal 11" string in a specific directory. I need the file details followed by the string.
I wrote a script to test out and play with Shell command since it's my first time to write a Shell script.
Let me cut the story short...
this command line: if ... (2 Replies)
Discussion started by: sai0899
2 Replies
6. Shell Programming and Scripting
I am using AIX and ksh.
I need to display the contents of a file that has a pid (process id). Because the file is open, it doesn't have the line feed or new line, so for some reason if I do this:
`cat $pid` , where $pid is the name of the fully qualified file, it displays
test3.sh: 426110:... (1 Reply)
Discussion started by: Gato
1 Replies
7. Shell Programming and Scripting
Hi All,
I've got a script to output YAML data, and I want to display data that's held inside variables inside one large CAT area. What's the easiest way to do this?
cat << "END"
---
classes:
- general_image
- $intro #Variable 1
- $mid #Variable 2
... (2 Replies)
Discussion started by: glarizza
2 Replies
8. Shell Programming and Scripting
Hello
This should be easy, but bash is giving me headaches.
At the command line the following command works:
duplicity --include /home --exclude '**' / file:///foo
Doing that from a script is not straightforward. Note that it is basically a requirement that I place the... (3 Replies)
Discussion started by: brsett
3 Replies
9. Shell Programming and Scripting
if i want to display the contents of a file between say line number 3 and 10 then i use the following command
sed -n '3,10p' filename
if this 3 was contained in x and 10 was contained in y then how wud this command modified?
sed -n '$x,$yp' filename does not work..please advise (2 Replies)
Discussion started by: arindamlive
2 Replies
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)