10-07-2008
Another problem is that the directory name starts with n. Something like this;
C:\ndm\stores
So, when I put like C:\\ndm\\stores, again, it takes \n as a line break.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the following situation
============
export DirectoryName=/tmp/xyz
if ; then
some_new_env=$DirectoryName"/*"
=======================
I tried all the ways of escaping the '*', but still the shell seems to expand the '*' character. I want some_new_env to contain "/tmp/xyz/*"
... (7 Replies)
Discussion started by: rkshukla14
7 Replies
2. Shell Programming and Scripting
I'm running into a problem with a differential backup script written in GNU Bash 3.0 - the following stripped down code demonstrates the problem quite nicely.
$ DATE="last tuesday"
$ date --date="$DATE"
Tue Jan 6 00:00:00 PST 2009
So far so good.
$ CMD="date --date=\"$DATE\""
$... (6 Replies)
Discussion started by: vertigo23
6 Replies
3. Shell Programming and Scripting
Hi All,
I am having a trouble in passing special characters to a script. As I am new to bash script I dont know how to go and solve this.
mypwd=(a+sdfg!h#
if i pass $mypwd to a bash script, it is not accepting "(,!,+ etc". It would be a great help if some one can help to escape these... (3 Replies)
Discussion started by: Tuxidow
3 Replies
4. 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
5. Shell Programming and Scripting
I'm cleaning this from some html files
style=''
but when I try
's/style=\'\''//'
I get an unmatched ' error (4 Replies)
Discussion started by: dba_frog
4 Replies
6. Shell Programming and Scripting
Hi
I use :
path=/var/www/admin
echo "$path" | sed -e 's/\//\\\//g'
this return
\/var\/www\/admin
and is ok.
but
path2=`echo "$path" | sed -e 's/\//\\\//g'`
echo $path2
return an error:
sed: -e expression #1, char 9: unknown option to `s'
Can anyone help me?
Thanks (3 Replies)
Discussion started by: georgian
3 Replies
7. Shell Programming and Scripting
Hello friends/'unix experts',
i have a file as below
cat sample.txt
satish
/rakesh/
sandhya
/sandeep/
i have to replace /rakesh/ with rakesh, how can i do it with sed, i tried below code but its throwing errors
sed -e 's/'"\(/rakesh/)\"'/\1rakesh/g' sample.txt
... (1 Reply)
Discussion started by: only4satish
1 Replies
8. Shell Programming and Scripting
So far what i've got is
egrep '^(\\)\*$'No luck.
I've searched the web and not much luck. I know about the escape character \ but its confusing to figure out how to use it to match a backslash and use it to escape the asterisk also. Any ides? Thanks! (8 Replies)
Discussion started by: matthewfs
8 Replies
9. Shell Programming and Scripting
So I understand that I should be able to ouput a literal \ by escaping it with a preceding \. My problem is that I am trying to ouput a script that will subsequently be run on a different system with UNC pathing, so I want to ouput two \\ in a row, but escaping them both in sequential order is not... (4 Replies)
Discussion started by: JourneyRider
4 Replies
10. UNIX for Beginners Questions & Answers
I am trying to echo a variable exactly to a script-
echo "${var1} ${var2} >> output.output
Gives me a blank file.
I would like output.output to basically say:
${var1} ${var2}
I think I need to use a special escape character for variables. Am I right in assuming that, and is it the... (8 Replies)
Discussion started by: jeffs42885
8 Replies
LEARN ABOUT CENTOS
putnextctl
putnextctl(9F) Kernel Functions for Drivers putnextctl(9F)
NAME
putnextctl - send a control message to a queue
SYNOPSIS
#include <sys/stream.h>
int putnextctl(queue_t *q, int type);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Queue to which the message is to be sent.
type Message type (must be control, not data type).
DESCRIPTION
putnextctl() tests the type argument to make sure a data type has not been specified, and then attempts to allocate a message block. put-
nextctl() fails if type is M_DATA, M_PROTO, or M_PCPROTO, or if a message block cannot be allocated. If successful, putnextctl() calls
the put(9E) routine of the queue pointed to by q with the newly allocated and initialized messages.
A call to putnextctl(q,type) is an atomic equivalent of putctl(q->q_next,type). The STREAMS framework provides whatever mutual exclusion is
necessary to insure that dereferencing q through its q_next field and then invoking putctl(9F) proceeds without interference from other
threads.
putnextctl() should always be used in preference to putctl(9F)
RETURN VALUES
On success, 1 is returned. If type is a data type, or if a message block cannot be allocated, 0 is returned.
CONTEXT
putnextctl() can be called from user or interrupt context.
EXAMPLES
The send_ctl routine is used to pass control messages downstream. M_BREAK messages are handled with putnextctl() (line 8). put-
nextctl1(9F) (line 13) is used for M_DELAY messages,
so that parm can be used to specify the length of the delay. In either case, if a message block cannot be allocated a variable record-
ing the number of allocation failures is incremented (lines 9, 14). If an invalid message type is detected, cmn_err(9F) panics the sys-
tem (line 18).
1 void
2 send_ctl(queue_t *wrq, uchar_t type, uchar_t parm)
3 {
4 extern int num_alloc_fail;
5
6 switch (type) {
7 case M_BREAK:
8 if (!putnextctl(wrq, M_BREAK))
9 num_alloc_fail++;
10 break;
11
12 case M_DELAY:
13 if (!putnextctl1(wrq, M_DELAY, parm))
14 num_alloc_fail++;
15 break;
16
17 default:
18 cmn_err(CE_PANIC, "send_ctl: bad message type passed");
19 break;
20 }
21 }
SEE ALSO
put(9E), cmn_err(9F), datamsg(9F), putctl(9F), putnextctl1(9F)
Writing Device Drivers
STREAMS Programming Guide
SunOS 5.10 29 Mar 1993 putnextctl(9F)