05-16-2018
Ah yes, I saw post#2 and thought "larger".
Then this thread and the previous thread actually have become duplicates.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
How can I match . (actual dot) using sed? Please help.
Thanks (9 Replies)
Discussion started by: jingi1234
9 Replies
2. Shell Programming and Scripting
I have a text file that has links in it.
I can write a match for sed to replace the link with anything.
For example:
http://www.google.com
becomes
XxX
But what I'm after is not to replace the link with something but to remove everything else and just leave the link. I want a... (5 Replies)
Discussion started by: muxman
5 Replies
3. Shell Programming and Scripting
Please help!
Input pattern, where ... could be any number of lines
struct A {
Blah1
Blah2
Blah3
...
} B;
output pattern
struct AB {
Blah1
Blah2
Blah3
...
};
I need help in extracting everything between { and }
if it would have been on a single line { \(.*\)} should have worked. (15 Replies)
Discussion started by: SiftinDotCom
15 Replies
4. UNIX for Dummies Questions & Answers
Hi:
it seems very strange.
there is a file with multiple lines. After I squeezed out the consecutive blank lines (and some other text processing), somehow the
sed '/\n/! d' file
can not generate any output, as if it can't find any line with newline.
the file is has many lines, so... (9 Replies)
Discussion started by: phil518
9 Replies
5. Shell Programming and Scripting
Hi,
I would like to use SED to do the following string replacement:
asd1abc to www1cda
asd2abc to www2cda
...
asd9abc to www9cda
I can use 'asd.abc' to find the orignal string, however I don't know how to generate the target string. Any suggestion?
Thanks,
... (2 Replies)
Discussion started by: mail4mz
2 Replies
6. Shell Programming and Scripting
Hi Guys
So far I have got this to work:
set x = temp1:temp2:temp3
echo $x | sed 's/.*:\(.*\).*/\1/'
Answer:
temp3
But I want answer as temp2:temp3, that is everything after the first ":" is found. If anybody can help with a bit of description that will be great.
Thanks in Advance (1 Reply)
Discussion started by: dixits
1 Replies
7. Shell Programming and Scripting
I would like replace all the rows in a file if a row has an exact match to number say 21 in a tab delimited file. I want to delete the row only if it has 21 any of the rows but it should not delecte the row that has 542178 or 563421.
I tried this
sed '/\<21\>/d' ./inputfile > output.txt
... (7 Replies)
Discussion started by: Kanja
7 Replies
8. Shell Programming and Scripting
I am using following sed rule to delete 2 lines after a pattern match inclusive.
# cat /tmp/temp.txt
dns.com
11
22
mydns.com
11
22
dns.com.au
11
22
LAST LINE
# cat /tmp/temp.txt | sed -e '/dns.com/,+2d'
LAST LINE
I just need to remove lines below dns.com only and NOT below... (5 Replies)
Discussion started by: anil510
5 Replies
9. Shell Programming and Scripting
Hi can anyone help with the following:
echo "Date range on 5th May is between -010516 and 050516- please continue "| sed 's/\(.*-\)\(.*-\)\(.*$\)/\2/'
output
010516 and 050516-
What i need is to include the - to be included.
Desired output:
-010516 and 050516-
I know... (11 Replies)
Discussion started by: andy391791
11 Replies
10. Shell Programming and Scripting
Hi, i have file file.txt with data like:
START
03:11:30 a
03:11:40 b
END
START
03:13:30 eee
03:13:35 fff
END
jjjjjjjjjjjjjjjjjjjjj
START
03:14:30 eee
03:15:30 fff
END
ggggggggggg
iiiiiiiiiiiiiiiiiiiiiiiii
I want the below output
START (13 Replies)
Discussion started by: Jyotshna
13 Replies
LEARN ABOUT HPUX
pthread_setcancelstate
pthread_setcancelstate(3T) pthread_setcancelstate(3T)
NAME
pthread_setcancelstate(), pthread_setcanceltype() - set and retrieve current thread's cancelability state or type.
SYNOPSIS
PARAMETERS
state Value to which the cancelability state of the calling thread is to be set.
oldstate Pointer to the location where the old cancelability state of the calling thread will be returned.
type Value to which the cancelability type of the calling thread is to be set.
oldtype Pointer to the location where the old cancelability type of the calling thread will be returned.
DESCRIPTION
atomically sets the calling thread's cancelability state to the value in state and returns the previous cancelability state in oldstate.
The legal values for state are:
Disable cancelability for the calling thread.
Cancellation requests against the calling thread are held pending.
Enable cancelability for the calling thread.
Cancellation requests against the calling thread may be acted upon. When a pending cancellation request will be acted upon
depends on the thread's cancelability type.
By default, a thread's cancelability state is set to when it is created.
atomically sets the calling thread's cancelability type to the value in type and returns the previous cancelability type in oldtype. The
legal values for type are:
New or pending cancellation requests against the calling thread may be acted
upon at any time (if cancellation is enabled for the calling thread).
Cancellation requests for the calling thread are held pending until a
cancellation point is reached.
A thread's cancelability type is set to when it is created.
If a thread's cancelability state is disabled, the setting of the thread's cancelability type has no immediate effect. All cancellation
requests are held pending. However, once cancelability is enabled again, the new type will be in effect.
RETURN VALUE
Upon successful completion, and return zero. Otherwise, an error number is returned to indicate the error (the variable is not set).
ERRORS
For each of the following conditions, if the condition is detected, the and functions return the corresponding error number:
[EINVAL] state contains an invalid value.
[EINVAL] type contains an invalid value.
NOTES
Only functions that are async-cancel safe should be called from a thread that is asynchronously cancelable.
AUTHOR
and were derived from the IEEE POSIX P1003.1c standard.
SEE ALSO
pthread_exit(3T), pthread_join(3T), pthread_cancel(3T), pthread_cond_wait(3T), pthread_cond_timedwait(3T).
STANDARDS CONFORMANCE
Pthread Library pthread_setcancelstate(3T)