I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message"
can someone check to see if the script is ok? and correct me pls.
Today is my first day with scripting.
Gurus should pls help out
#!/bin/ksh
# Purpose: Check to see if file... (3 Replies)
Hi Team,
I am new to this forum and also trying to learn Unix.
I will highly appriciate your help if you can help me to get the right command .
{{{
I use the command " today | egrep '(10:| 11: )' | grep ERROR " to grep all the files that has been error betweeen 10 to 11... (6 Replies)
I have a script that has been running fine for about a month - now all of a sudden I am getting a syntax error using the egrep command. The command I am using is comparing two files and printing only the unique lines from Second_File to Third_File. Any idea why I am getting the syntax error??
... (4 Replies)
Hi,
As you can see I'm trying to get email addresses from the mail.log.
This is a part of a bash shell script I found but I#m wondering how I can check the
variable $1?
When I try
egrep -i "(from|to)=<$1>" mail.log | awk ' {print $1}'
either from the command line or from a script it... (12 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
So far what i've got is
egrep '^(\\)\*$'No luck.
I've searched the web and not much luck. I know about the escape character \ but its confusing to figure out how to use it to match a backslash and use it to escape the asterisk also. Any ides? Thanks! (8 Replies)
Hi All,
Please hav a look at the below peice of script and let me know if there are any syntax errors.
i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
I am executing following command
egrep -w I filename.txt
the filename.txt has following data ....
-I 07-18 08:31:19.924 9880 6 SessionManager ConnectConfig: ConfigurationWebService LoginResults=SuccessfulLogin
I am so hungry that I need to eat
I expect egrep to print only the second... (1 Reply)
Hi,
Is anyone able to shed some light on "+r"?
I know -r in grep refers to a recursive search - I am curious to know what +r specifies.
#show process pidin | utility egrep -e "+r" count
2492
Thanks. (3 Replies)
Discussion started by: sand1234
3 Replies
LEARN ABOUT PHP
regcmp
regcmp(1) User Commands regcmp(1)NAME
regcmp - regular expression compile
SYNOPSIS
regcmp [-] filename...
DESCRIPTION
The regcmp command performs a function similar to regcmp and, in most cases, precludes the need for calling regcmp from C programs. Bypass-
ing regcmp saves on both execution time and program size. The command regcmp compiles the regular expressions in filename and places the
output in filename.i.
OPTIONS
- If the - option is used, the output is placed in filename.c. The format of entries in filename is a name (C variable) followed by
one or more blanks followed by one or more regular expressions enclosed in double quotes. The output of regcmp is C source code.
Compiled regular expressions are represented as extern char vectors. filename.i files may thus be #included in C programs, or
filename.c files may be compiled and later loaded. In the C program that uses the regcmp output, regex(abc,line) applies the regu-
lar expression named abc to line. Diagnostics are self-explanatory.
EXAMPLES
Example 1: Examples of the regcmp command.
name "([A-Za-z][A-Za-z0-9_]*)$0"
telno "({0,1}([2-9][01][1-9])$0){0,1} *"
"([2-9][0-9]{2})$1[ -]{0,1}"
"([0-9]{4})$2"
The three arguments to telno shown above must all be entered on one line.
In the C program that uses the regcmp output,
regex(telno, line, area, exch, rest)
applies the regular expression named telno to line.
ENVIRONMENT VARIABLES
A general description of the usage of the LC_* environmental variables can be found in environ(5).
LC_CTYPE Determines how regcmp handles characters. When LC_CTYPE is set to a valid value, regcmp can display and handle text and
filenames containing valid characters for that locale.
LC_MESSAGES Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and
the correct form of affirmative and negative responses. In the "C" locale, the messages are presented in the default form
found in the program itself (in most cases, U.S. English).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWtoo |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
SEE ALSO regcmp(3C), attributes(5), environ(5)SunOS 5.10 Dec 20 1996 regcmp(1)