i have this script that searches for a pattern.
However it fails if the pattern includes some
special characters. So far, it fails with the
following strings:
1. -Cr
2. $Mj
3. H'412
would a sed or awk be more effective?
i don't want the users to put the (\)
during the search (they... (5 Replies)
Hello-
I have a variables that contains a string like this usr/pass@SCHEMA
I want to extract the usr/pass part and ignore the SCHEMA part, I tried to use this ${dbconn%%@} and apparently it will not work because @ is a special character. I tried \@ and still no go.
Any idea how to solve... (1 Reply)
Hello,
I am trying the following:
echo __CHANGEME__ >> testfile
VAR1="&&&"
sed -i "s|__CHANGEME__|${VAR1}|" testfile
cat testfile
This results in testfile containing
__CHANGEME____CHANGEME____CHANGEME__
Whereas I want it to result in
&&&
I understand that if
VAR1="\&\&\&"
then... (3 Replies)
This has been covered many times earlier but couldnt figure the issue myself. Can you please advise whats wrong on the below code
I have a variable with special character ($) and am using that variable to replace another variable in file but however sed is failing to parse it correctly
... (7 Replies)
Hello all,
I am facing with a problem of invoking an environment variable.
If I use this command :
/bin/ls -lt FILE_NM_?(20120515|20120516)??????_sas.sig | head -n1 | awk '{print $9}'
It perfectly outputs the desired result.
FILE_NM_20120516000000_sas.sig
But if I do this:... (8 Replies)
Hey guys,
I know that title is a mouthful - I'll try to better explain my struggles a little better...
What I'm trying to do is:
1. Query a db and output to a file, a list of column data.
2. Then, for each line in this file, repeat these values but wrap them with:
ITEM{
... (3 Replies)
Hi
I have a scenario where hyphen(-) from file should be ignored
I used the following code
if && ; then
if ; then
pow=$LINE
echo $pow > history.txt
flag=1
fi
fi
I get the following output
./valid.sh: -: 0403-012 A test... (7 Replies)
Hi,
I am fairly new to unix scripting and recently tasked with some reporting scripts.
The reporting checks several batch jobs and this is quite iterative.
Now I am trying to minimize script effort and maximize reusability as there are only slight nuances in the repetitive tasks.
For... (3 Replies)
Hello Folks,
Need to bisect strings based on a subset.
Below works good.
echo /a/b/c/d | awk -F"/c/d$" '{print $1}'
/a/b
However, it goes awry with special characters.
echo /a/b/c+/d | awk -F"/c+/d$" '{print $1}'
/a/b/c+/d
Desired output:
/a/b
Escaping the special characters... (11 Replies)
If I have a file like the following
abc.1
abc
abc_1
abc..1
abc*1
abc@1
abc def ghr
def......
ddef 5466 def ed
def** 123445
I`m trying to find exact words from the list
abc
def (4 Replies)
Discussion started by: ritakadm
4 Replies
LEARN ABOUT NETBSD
pserialize
PSERIALIZE(9) BSD Kernel Developer's Manual PSERIALIZE(9)NAME
pserialize -- passive serialization mechanism
SYNOPSIS
#include <sys/pserialize.h>
pserialize_t
pserialize_create(void);
void
pserialize_destroy(pserialize_t psz);
int
pserialize_read_enter(void);
void
pserialize_read_exit(int s);
void
pserialize_perform(pserialize_t psz);
DESCRIPTION
Passive serialization is a reader / writer synchronisation mechanism designed for lock-less read operations. The read operations may happen
from software interrupt at IPL_SOFTCLOCK.
FUNCTIONS
pserialize_create()
Allocate a new synchronisation object.
pserialize_destroy()
Destroy the synchronisation object. No synchronisation activity should happen at this point.
pserialize_read_enter()
Enter the critical path of the reader side. Returns an IPL value, which must be passed to pserialize_read_exit(9). Protected code
path is not allowed to block.
pserialize_read_exit()
Exit the critical path of the reader side. Takes the IPL value returned by pserialize_read_enter(9).
pserialize_perform()
Perform the passive serialization on the writer side. Passing of this function ensures that no readers are in action. Writers must
be additionally serialized with a separate mechanism, e.g. mutex(9). Operation blocks and it may only be performed from thread
context.
EXAMPLES
Typical code fragment in the writer side:
mutex_enter(&writer_psz_lock);
/*
* Perform the updates (e.g. remove data items from a list).
*/
...
pserialize_perform(object->psz);
/*
* At this point it is safe to destroy old data items.
*/
mutex_exit(&writer_psz_lock);
CODE REFERENCES
The pserialize is implemented within the file sys/kern/subr_pserialize.c.
SEE ALSO membar_ops(3), condvar(9), mutex(9), rwlock(9)
Hennessy, et al., Passive serialization in a multitasking environment, US Patent and Trademark Office, US Patent 4809168, February 28, 1989.
HISTORY
Passive serialization mechanism first appeared in NetBSD 6.0.
BSD July 30, 2011 BSD