I want to grep a range of numbers in a log file. My log file looks like this:
20050807070609Z;blah blah
That is a combination of yr,month,date,hours,minutes,seconds.
I want to search in the log file events that happened between a particular time.
like between 20050807070000 to 20050822070000... (1 Reply)
Hi im new to unix and need to find a way to grep the top 5 numbers in a file and put them into another file. For example my file looks like this
abcdef 50000
abcdef 45000
abcdef 40000
abcdef 35000
abcdef 30000
abcdef 25000
abcdef 20000
abcdef 15000
abcdef 10000
and so on...
How can... (1 Reply)
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
I have a data file that has 6 columns and I have sorted the 3rd column so that all rows are sorted according to the 3rd column (from lowest to highest number). An example is shown below:
7563 273 1 -15.81100000 25.37250000 -19.27320000
8149 294 1 -17.90540000 ... (3 Replies)
Dear Friends,
I want to know how to grep for the lines that has a number between given range(start and end).
I have tried the following sed command.
sed -n -e '/20030101011442/,/20030101035519/p'
However this requires both start and end to be part of the content being grepped. However... (4 Replies)
I am trying to extract specific information from a large *.sam file (it's originally 28Gb).
I want to extract all lines that are on chr3 somewhere in the range of 112,937,439-113,437,438.
Here is a sample line from my file so you can get a feel for what each line looks like:
seq.4 0 ... (8 Replies)
Hi,
I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would..
Can some one tell me what I'm doing wrong?
*****@********>echo $mynumber ... (4 Replies)
Hi
I am getting an argument which specifies the range of numbers. eg: 7-15
Is there a way that i can easily (avoiding loop) print the range of number between and including the specified above.
The above example should translate to 7,8,9,10,11,12,13,14,15 (3 Replies)
Discussion started by: tostay2003
3 Replies
LEARN ABOUT REDHAT
system
SYSTEM(3) Linux Programmer's Manual SYSTEM(3)NAME
system - execute a shell command
SYNOPSIS
#include <stdlib.h>
int system(const char *string);
DESCRIPTION
system() executes a command specified in string by calling /bin/sh -c string, and returns after the command has been completed. During
execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.
RETURN VALUE
The value returned is -1 on error (e.g. fork failed), and the return status of the command otherwise. This latter return status is in the
format specified in wait(2). Thus, the exit code of the command will be WEXITSTATUS(status). In case /bin/sh could not be executed, the
exit status will be that of a command that does exit(127).
If the value of string is NULL, system() returns nonzero if the shell is available, and zero if not.
system() does not affect the wait status of any other children.
CONFORMING TO
ANSI C, POSIX.2, BSD 4.3
NOTES
As mentioned, system() ignores SIGINT and SIGQUIT. This may make programs that call it from a loop uninterruptable, unless they take care
themselves to check the exit status of the child. E.g.
while(something) {
int ret = system("foo");
if (WIFSIGNALED(ret) &&
(WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT))
break;
}
Do not use system() from a program with suid or sgid privileges, because strange values for some environment variables might be used to
subvert system integrity. Use the exec(3) family of functions instead, but not execlp(3) or execvp(3). system() will not, in fact, work
properly from programs with suid or sgid privileges on systems on which /bin/sh is bash version 2, since bash 2 drops privileges on
startup. (Debian uses a modified bash which does not do this when invoked as sh.)
The check for the availability of /bin/sh is not actually performed; it is always assumed to be available. ISO C specifies the check, but
POSIX.2 specifies that the return shall always be non-zero, since a system without the shell is not conforming, and it is this that is
implemented.
It is possible for the shell command to return 127, so that code is not a sure indication that the execve() call failed.
SEE ALSO sh(1), signal(2), wait(2), exec(3)
2001-09-23 SYSTEM(3)