01-16-2007
I found this browsing around that will somewhat do:
sed "s/.*\(S[0-9][0-9][0-9][0-9][0-9][0-9][0-9].LOG\).*/\1/" file
what it gives me is a list that looks like this:
S0000582.LOG
S0000576.LOG
S0000573.LOG
S0000569.LOG
S0000567.LOG
S0000566.LOG
S0000562.LOG
S0000562.LOG
S0000562.LOG
S0000559.LOG
S0000553.LOG
S0000000.LOG
While thats not exactly what I want, I believe I can pull out the 4th line, which will tell me what I need. Any one know of a better way to do this?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
What command can I use to simply edit a file by searching for a word and then deleting the lines that I find that word in? (4 Replies)
Discussion started by: capesong
4 Replies
2. Shell Programming and Scripting
Could someone please tell me how to delete all lines above a line which contains a particular string? (possibly using SED command)
I know how to do this if the target string appears in only one line of file but when it appears in multiple lines it only deletes from the first line which the string... (3 Replies)
Discussion started by: stevefox
3 Replies
3. Shell Programming and Scripting
I'm trying to write a simple script to figure pay with overtime...I got the first part to work, but I can't seem to get the second if statement's syntax right...:confused:I want it to take the 40 hours times 10 dollars, but then i want whatever is left over (like 7 of 47 hours) and take that times... (6 Replies)
Discussion started by: miss72006
6 Replies
4. Shell Programming and Scripting
What is an efficient way to remove all lines from the input file which contain a file name?
inputfile:
=======================
# comment
# comment
# comment
5 8 10 /tmp
5 8 10 /var/run
5 8 10 /etc/vfstab
5 8 9 /var/tmp
5 8 10 /var/adm/messages... (7 Replies)
Discussion started by: Arsenalman
7 Replies
5. Shell Programming and Scripting
Hello,
I am attempting to create a command that I can eventually put into a loop so I can edit 1file on many servers. I would like to edit the file in place with sed -i. If not I will take any suggestions on how to use a temp file. I need to remove a email address from the configuration file... (4 Replies)
Discussion started by: abacus
4 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
I want to edit nth filed of a comma delimited line with some value. Can I use sed command to do this.
Pls suggest me the command here.
Thanks,
Poova. (2 Replies)
Discussion started by: poova
2 Replies
7. Shell Programming and Scripting
please help me to edit the second field using awk or sed
i have input file below
aa1001 000001
bb1002 000002
cc1003 000003
so i want the output file like below
aa1001 01
bb1002 02
cc1003 03 (38 Replies)
Discussion started by: zulabc
38 Replies
8. Shell Programming and Scripting
Hi,
I have an ascii file with recurring lines (the file is 36mb so lots of lines) which look like this:
-2.5 -66.324-68.138 935.2 1.953 -0.664 272.617 73.684 -2.428 269.998 0.000
Every 14 lines there is a blank line.
I would like to, for each non-blank line,... (2 Replies)
Discussion started by: blueade7
2 Replies
9. Shell Programming and Scripting
how can i make this sed command run faster?
sed '51000000,51347442!d' file
and
sed '51347442,$ !d' file
File is a 9GB in size.
it runs on sunos 5.10 and linux red hat 6 servers and i use bash. (5 Replies)
Discussion started by: SkySmart
5 Replies
10. Shell Programming and Scripting
Created a shell script to invoke sed to edit multiple files, but am missing something.
Here's the shell script:
oracle:$ cat edit_scripts.sh
#!/bin/sh
#------------------------------------------------------------------------------
# edit_scripts.sh
#
# This script executes sed to make global... (4 Replies)
Discussion started by: edstevens
4 Replies
LOG(3) Linux Programmer's Manual LOG(3)
NAME
log, logf, logl - natural logarithmic function
SYNOPSIS
#include <math.h>
double log(double x);
float logf(float x);
long double logl(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
logf(), logl():
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
or cc -std=c99
DESCRIPTION
The log() function returns the natural logarithm of x.
RETURN VALUE
On success, these functions return the natural logarithm of x.
If x is a NaN, a NaN is returned.
If x is 1, the result is +0.
If x is positive infinity, positive infinity is returned.
If x is zero, then a pole error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively.
If x is negative (including negative infinity), then a domain error occurs, and a NaN (not a number) is returned.
ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions.
The following errors can occur:
Domain error: x is negative
errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised.
Pole error: x is zero
errno is set to ERANGE. A divide-by-zero floating-point exception (FE_DIVBYZERO) is raised.
CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD, C89.
BUGS
In glibc 2.5 and earlier, taking the log() of a NaN produces a bogus invalid floating-point (FE_INVALID) exception.
SEE ALSO
cbrt(3), clog(3), log2(3), log10(3), log1p(3), sqrt(3)
COLOPHON
This page is part of release 3.27 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/.
2010-09-20 LOG(3)