12-08-2008
Please resolve it
I already done it by using grep command, but according to our requirement , we have to do it bu using only regular expressions.Can anyone tell me hoe it can be done by using regular expressions in unix shell programming
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Iam using split command to split the files.
Splitted files will be named as xaa
xab
xac
xad etc.
Directories will be test1,test2,test3.....
Now i want to select the splitted files one by one and have to place in test directories.
can anybody give the soulution??? (2 Replies)
Discussion started by: nivas
2 Replies
2. Shell Programming and Scripting
Hi,
i want to read a full file.
If i want to split the file and by reading parralel each, i can save the time.
Can any body give me the suggesion??
ia m using this function to read a file and using that i have to grep in another file. since the file 1 is huge it is taking lot of time.
... (3 Replies)
Discussion started by: nivas
3 Replies
3. Shell Programming and Scripting
Hi,
I am looking for a PDF or an e-book which can show in details how to do Shell Scripting or Programming. Can anybody provide me with a link to such a tutorial? I have downloaded some tutorials but they show only basics and not give any in-depth study material.
I am using Red Hat Linux... (2 Replies)
Discussion started by: indiansoil
2 Replies
4. Shell Programming and Scripting
Hi Gurus
I am very new to Unix Shell Prog. I have a file in format
Q1 Dirname-FileName Score Remarks
i.e. containing columns separated by space. I want to read Column 1 and 2 and then join them to make a string that would be a path to a file. I will use this string to fetch the files and... (4 Replies)
Discussion started by: kimskams80
4 Replies
5. UNIX for Dummies Questions & Answers
How does unix system administration, unix programming, unix network programming differ?
Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies
6. Shell Programming and Scripting
Hi guys
i have two different line
input
M5.7&a : M5 minimum density is 20%, maximum density is 80%,
DENSITY PERM=M5.8&a(180) ......... 6 violations found.
M6.7&a : M6 minimum density is 20%, maximum density is 80%,
DENSITY A=M6.8&a(180) ......... 6 violations found.
need... (2 Replies)
Discussion started by: ashokkrishna063
2 Replies
7. Shell Programming and Scripting
Guys,
What do you think is the best way to learn UNIX and shell scripting?
** I keep on searching tutorials online, where I loose most of my time :(
Let me know the way you learnt the UNIX concepts, your replies might help me learn more.
Thanks a ton:b: (2 Replies)
Discussion started by: dnam9917
2 Replies
8. Shell Programming and Scripting
Hello! :)
I currently got the task of programming a UNIX Shell for practice. The functionality is as follows:
1. Entering commands with the keyboard. Enter stops the input and creates a process which should start any program
2. the shell waits for termination of each command before... (1 Reply)
Discussion started by: DarkDan
1 Replies
9. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Hello! :)
I currently got the task of programming a UNIX Shell for practice. The functionality is as follows:
1. Entering commands with the keyboard. Enter stops the input and creates a process which should start any program
2.... (0 Replies)
Discussion started by: DarkDan
0 Replies
10. Homework & Coursework Questions
Create 2 files in unix in 2 different directories, compare them and fetch common words between these 2 files. Print them on the screen and also redirect the output to your home directory in the below format: file 1 | file 2 line no: word 1 | line no: word 1 line no: word 2 | line no: word 2 line... (11 Replies)
Discussion started by: mounica bijjala
11 Replies
LEARN ABOUT SUNOS
re_comp
re_comp(3C) Standard C Library Functions re_comp(3C)
NAME
re_comp, re_exec - compile and execute regular expressions
SYNOPSIS
#include <re_comp.h>
char *re_comp(const char *string);
int re_exec(const char *string);
DESCRIPTION
The re_comp() function converts a regular expression string (RE) into an internal form suitable for pattern matching. The re_exec() func-
tion compares the string pointed to by the string argument with the last regular expression passed to re_comp().
If re_comp() is called with a null pointer argument, the current regular expression remains unchanged.
Strings passed to both re_comp() and re_exec() must be terminated by a null byte, and may include NEWLINE characters.
The re_comp() and re_exec() functions support simple regular expressions, which are defined on the regexp(5) manual page. The regular
expressions of the form {m}, {m,}, or {m,n} are not supported.
RETURN VALUES
The re_comp() function returns a null pointer when the string pointed to by the string argument is successfully converted. Otherwise, a
pointer to one of the following error message strings is returned:
No previous regular expression
Regular expression too long
unmatched (
missing ]
too many () pairs
unmatched )
Upon successful completion, re_exec() returns 1 if string matches the last compiled regular expression. Otherwise, re_exec() returns 0 if
string fails to match the last compiled regular expression, and -1 if the compiled regular expression is invalid (indicating an internal
error).
ERRORS
No errors are defined.
USAGE
For portability to implementations conforming to X/Open standards prior to SUS, regcomp(3C) and regexec(3C) are preferred to these func-
tions. See standards(5).
SEE ALSO
grep(1), regcmp(1), regcmp(3C), regcomp(3C), regexec(3C), regexpr(3GEN), regexp(5), standards(5)
SunOS 5.10 26 Feb 1997 re_comp(3C)