Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line.
Thanks. (5 Replies)
Hi there I have a list of mac addresses that are in this format
0100237D2136XX
0118A905599EXX
0118A9054E15XX
010003BAF1F3XX
0118A905599EXX
0100237D6522XX
010C53BAF1F3XX
010003BAF1F3XX
010C53BAF1F3XX
The 01 is at the beginning has been put on by my software, but the rest is the mac... (0 Replies)
What is a regex for "the dalai lama, his holiness the"
that would just grab "the dalai lama"
and one that would just grab "his holiness the"? Both should exclude the comma..
I was trying '^.*' and many variants with no luck. (6 Replies)
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Hello.
I am using :
sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \
#'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \
#'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE"
Is there a better way to define "MY_TAB7","MY_TAB11" in other way than :
MY_TAB1=$'\t'
MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Hi Guys,
I have serveral directories like this:
(2013) blablabla(blabla) - blabla (blabla)
or
(1997) blablabla(blabla) - blabla (blabla)
and have to rename them to something like that:
blablabla(blabla) - blabla (blabla) (2013)
and
blablabla(blabla) - blabla (blabla) (1997)
Easy... (2 Replies)
I would like to insert n number of characters at the beginning of each line that starts with a given character. If possible, I would be most appreciative for a sed or awk solution.
Given the data below, I would like to be able to insert either 125 spaces or 125 "-" at the beginning of every line... (6 Replies)
Discussion started by: jvoot
6 Replies
LEARN ABOUT DEBIAN
re_exec
RE_COMP(3) Linux Programmer's Manual RE_COMP(3)NAME
re_comp, re_exec - BSD regex functions
SYNOPSIS
#define _REGEX_RE_COMP
#include <sys/types.h>
#include <regex.h>
char *re_comp(char *regex);
int re_exec(char *string);
DESCRIPTION
re_comp() is used to compile the null-terminated regular expression pointed to by regex. The compiled pattern occupies a static area, the
pattern buffer, which is overwritten by subsequent use of re_comp(). If regex is NULL, no operation is performed and the pattern buffer's
contents are not altered.
re_exec() is used to assess whether the null-terminated string pointed to by string matches the previously compiled regex.
RETURN VALUE
re_comp() returns NULL on successful compilation of regex otherwise it returns a pointer to an appropriate error message.
re_exec() returns 1 for a successful match, zero for failure.
CONFORMING TO
4.3BSD.
NOTES
These functions are obsolete; the functions documented in regcomp(3) should be used instead.
SEE ALSO regcomp(3), regex(7), GNU regex manual
COLOPHON
This page is part of release 3.44 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/.
GNU 1995-07-14 RE_COMP(3)