05-22-2014
Sorry I forgot to mention, that you should have gnu awk to use --re-interval
This User Gave Thanks to Akshay Hegde For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
Discussion started by: kousikan
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a file with large number of records. Sample below:
123456789QWERT2U 2 erter
987123678ZXCVB6Y 5 7689
934567123GHJKUI4O 7
-
--
--
I want the 16th character in each record to be replaced with the below as follows;so 2 will become K, 6 will become O and 4 will become... (3 Replies)
Discussion started by: er_ashu
3 Replies
3. Shell Programming and Scripting
Hello Experts,
I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn.
AIM: The script has some commented and some uncommented lines. I need to :
... (2 Replies)
Discussion started by: hkansal
2 Replies
4. Shell Programming and Scripting
New to sed...
Have a file foo.txt (below).
Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique).
So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line.
What I have thus far:
sed -e... (6 Replies)
Discussion started by: boolean2222
6 Replies
5. Shell Programming and Scripting
in vi editor I want to replace next line char by space
help me
eg:
input:
123
123
123
output:
123 123 123 (5 Replies)
Discussion started by: RahulJoshi
5 Replies
6. Shell Programming and Scripting
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
Discussion started by: anilvk
3 Replies
7. Shell Programming and Scripting
Input file
data20714 7327 7366 detail
data20714 7327 7366 main
data250821 56532 57634 detail
data250821 57527 57634 main
data250821 57359 57474 main
data250821 57212 57301 main
data250821 57140 57159 detail
data250821 56834 57082 main
data250821 56708 56779 main ... (3 Replies)
Discussion started by: perl_beginner
3 Replies
8. Shell Programming and Scripting
Hi How Are you?
I am doing fine!
I need to go now?
I will see you tomorrow!
Basically I need to replace the entire line containing "doing" with a blank line:
I need to the following output:
Hi How Are you?
I need to go now?
I will see you tomorrow!
Thanks in advance.... (1 Reply)
Discussion started by: sags007_99
1 Replies
9. Shell Programming and Scripting
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies
10. UNIX for Advanced & Expert Users
Unix File is pipe delimited with 17 fields. We may get extra pipes in data also.
We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n.
Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
UALARM(3) Linux Programmer's Manual UALARM(3)
NAME
ualarm - schedule signal after given number of microseconds
SYNOPSIS
#include <unistd.h>
useconds_t ualarm(useconds_t usecs, useconds_t interval);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
ualarm(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
DESCRIPTION
The ualarm() function causes the signal SIGALRM to be sent to the invoking process after (not less than) usecs microseconds. The delay may
be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers.
Unless caught or ignored, the SIGALRM signal will terminate the process.
If the interval argument is nonzero, further SIGALRM signals will be sent every interval microseconds after the first.
RETURN VALUE
This function returns the number of microseconds remaining for any alarm that was previously set, or 0 if no alarm was pending.
ERRORS
EINTR Interrupted by a signal.
EINVAL usecs or interval is not smaller than 1000000. (On systems where that is considered an error.)
CONFORMING TO
4.3BSD, POSIX.1-2001. POSIX.1-2001 marks ualarm() as obsolete. POSIX.1-2008 removes the specification of ualarm(). 4.3BSD, SUSv2, and
POSIX do not define any errors.
NOTES
The type useconds_t is an unsigned integer type capable of holding integers in the range [0,1000000]. On the original BSD implementation,
and in glibc before version 2.1, the arguments to ualarm() were instead typed as unsigned int. Programs will be more portable if they
never mention useconds_t explicitly.
The interaction of this function with other timer functions such as alarm(2), sleep(3), nanosleep(2), setitimer(2), timer_create(2),
timer_delete(2), timer_getoverrun(2), timer_gettime(2), timer_settime(2), usleep(3) is unspecified.
This function is obsolete. Use setitimer(2) or POSIX interval timers (timer_create(2), etc.) instead.
SEE ALSO
alarm(2), getitimer(2), nanosleep(2), select(2), setitimer(2), usleep(3), time(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-08-06 UALARM(3)