11-05-2014
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have data as follows in a text file
<key='data1'>
<String>abcdef</String>
<String>abcdef1</String>
<String>abcdef2</String>
</key>
<key='data2'>
<String>abcdef</String>
<String>abcdef1</String>
<String>abcdef2</String>
<String>abcdef3</String>
</key>
Is there a way i... (10 Replies)
Discussion started by: userscript
10 Replies
2. Shell Programming and Scripting
Sample data:
revision001 | some text | some text
Comment: some comment
Brief: 1) brief
2) brief
------------------------------------------
revision002 | some text | some text
Brief: 1) brief
2) brief
FIX: some fix
------------------------------------------
revision003 | some... (8 Replies)
Discussion started by: inotech
8 Replies
3. Shell Programming and Scripting
Hi , I have a billing CDR file which has repeated lines as indicated below and I need to extract data between two strings (i.e.: <?> and </?>). Eventually, map that information with the corresponding field. I'm new to unix, any help will be greatly appreciated.
Gamini
Input (single line):
!... (3 Replies)
Discussion started by: jaygamini
3 Replies
4. UNIX for Dummies Questions & Answers
Hello guys,
should be a very easy questn for you:
I need to delete strings in file1 based on the list of strings in file2.
like file2:
word1_word2_
word3_word5_
word3_word4_
word6_word7_
file1:
word1_word2_otherwords..,word3_word5_others... (7 Replies)
Discussion started by: roussine
7 Replies
5. Shell Programming and Scripting
Hi ,
I'm a newbie.Never worked on Unix before. I want a shell script to perform the following:
I want to extract strings from each line ,based on the type of line(Nameline,Subline) and output it to another file.Below is a sample format.
2010-12-21 14:00"1"Nameline"Midterm"First Name:Jane ... (4 Replies)
Discussion started by: angie1234
4 Replies
6. Shell Programming and Scripting
I have the following lines in a log file. It would be great if some one can help me to create a new file with the just entries in the below format.
66.150.161.195 HPSAC=Z05
66.150.161.196 HPSAC=A05
That is just extract the IP address and the string DPSAC=its value
66.150.161.195 -... (1 Reply)
Discussion started by: Tuxidow
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
Im having some problems with this. I have loaded a file with html code. All code is placed in the same line. I want to get everything between two given strings (including these strings and get only the first appearance).
Example:
File contains <html><body><a href='a.html'>abc</a><a... (5 Replies)
Discussion started by: ngb
5 Replies
8. UNIX for Dummies Questions & Answers
Dear all,
I have a data like below (n of rows=400,000) and I want to extract the rows with certain strings. I use code below. It works if there is not too many strings for example n of strings <5000. while I have 90,000 strings to extract. If I use the egrep code below, I will get error:
... (3 Replies)
Discussion started by: forevertl
3 Replies
9. UNIX for Beginners Questions & Answers
Hello
i am stuck with this.
i have input which is as follows
/type/work /works/OL10627594W 3 2019-04-24T16:46:21.351549 {"created": {"type": "/type/datetime", "value": "2009-12-11T03:18:17.488715"}, "title": "Tog the dog", "covers": , "last_modified": {"type":... (3 Replies)
Discussion started by: ahfze
3 Replies
10. Shell Programming and Scripting
I am having the following output when executing a dig command :
dig @1.1.1.1 google.com +noall +answer +stats
; <<>> DiG 9.11.4-P1 <<>> @1.1.1.1 google.com +noall +answer +stats
; (1 server found)
;; global options: +cmd obodrm.prod.at.dmdsdp.com. 86154 IN A ... (1 Reply)
Discussion started by: liviusbr
1 Replies
LEARN ABOUT NETBSD
pthread_mutexattr_gettype
PTHREAD_MUTEXATTR(3) BSD Library Functions Manual PTHREAD_MUTEXATTR(3)
NAME
pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_settype, pthread_mutexattr_gettype -- mutex attribute operations
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_mutexattr_init(pthread_mutexattr_t *attr);
int
pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
int
pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
int
pthread_mutexattr_gettype(pthread_mutexattr_t * restrict attr, int * restrict type);
DESCRIPTION
Mutex attributes are used to specify parameters to pthread_mutex_init(). Like with thread attributes, one attribute object can be used in
multiple calls to pthread_mutex_init(3), with or without modifications between calls.
The pthread_mutexattr_init() function initializes attr with all the default mutex attributes.
The pthread_mutexattr_destroy() function destroys attr.
The pthread_mutexattr_settype() functions set the mutex type value of the attribute. Valid mutex types are:
PTHREAD_MUTEX_NORMAL
This type of mutex does not check for usage errors. It will deadlock if reentered, and result in undefined behavior if a locked mutex
is unlocked by another thread. Attempts to unlock an already unlocked PTHREAD_MUTEX_NORMAL mutex will result in undefined behavior.
PTHREAD_MUTEX_ERRORCHECK
These mutexes do check for usage errors. If an attempt is made to relock a PTHREAD_MUTEX_ERRORCHECK mutex without first dropping the
lock, an error will be returned. If a thread attempts to unlock a PTHREAD_MUTEX_ERRORCHECK mutex that is locked by another thread, an
error will be returned. If a thread attempts to unlock a PTHREAD_MUTEX_ERRORCHECK thread that is unlocked, an error will be returned.
PTHREAD_MUTEX_RECURSIVE
These mutexes allow recursive locking. An attempt to relock a PTHREAD_MUTEX_RECURSIVE mutex that is already locked by the same thread
succeeds. An equivalent number of pthread_mutex_unlock(3) calls are needed before the mutex will wake another thread waiting on this
lock. If a thread attempts to unlock a PTHREAD_MUTEX_RECURSIVE mutex that is locked by another thread, an error will be returned. If
a thread attempts to unlock a PTHREAD_MUTEX_RECURSIVE thread that is unlocked, an error will be returned.
It is advised that PTHREAD_MUTEX_RECURSIVE mutexes are not used with condition variables. This is because of the implicit unlocking
done by pthread_cond_wait(3) and pthread_cond_timedwait(3).
PTHREAD_MUTEX_DEFAULT
Also this type of mutex will cause undefined behavior if reentered. Unlocking a PTHREAD_MUTEX_DEFAULT mutex locked by another thread
will result in undefined behavior. Attempts to unlock an already unlocked PTHREAD_MUTEX_DEFAULT mutex will result in undefined behav-
ior.
This is the default mutex type for pthread_mutexaddr_init().
The pthread_mutexattr_gettype() functions copy the type value of the attribute to the location pointed to by the second parameter.
RETURN VALUES
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.
ERRORS
The pthread_mutexattr_init() function shall fail if:
[ENOMEM] Insufficient memory exists to initialize the mutex attributes object.
The pthread_mutexattr_settype() function shall fail if:
[EINVAL] The value specified either by type or attr is invalid.
No error numbers are defined for the pthread_mutexattr_destroy() and pthread_mutexattr_gettype() functions.
SEE ALSO
pthread_mutex_init(3)
STANDARDS
These functions conform to IEEE Std 1003.1-2001 (``POSIX.1'').
BSD
July 9, 2010 BSD