11-12-2013
Thanks Kris, Its working fine for me.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies
2. Shell Programming and Scripting
How do I filter only comments and still keep Line breaks at the end of the line!?
This is one of the common tasks we all do,, How can we do this in a right way..!?
I try to ignore empty lines and commented lines using following approach.
test.sh
# \040 --> SPACE character octal... (17 Replies)
Discussion started by: kchinnam
17 Replies
3. UNIX for Advanced & Expert Users
Hi Gurus,
I'm need of a script in which we are finding an independent word ‘boy' in a log file. We are using grep in order to do the same. Now in this log file there are some sentences where we see ‘This is a boy' and we do not want to count word ‘boy' from this sentence.
So in other word we want... (2 Replies)
Discussion started by: heyitsmeok
2 Replies
4. Shell Programming and Scripting
:) Hi all,
I would like to remove all multiple line comments, in between the pattern /*.....*/ from my file.
The comments can be expected to be at any place in my file, like this:
/*....
This multi line comment might stretch even the entire file..!
......*/
Some text
Text1 /* Comment... (25 Replies)
Discussion started by: Jackuar
25 Replies
5. Shell Programming and Scripting
Hi All,
I have text file like as below
temp.txt 1 Line
temp.txt 2 Line
temp.txt 3 Line
temp.txt 4 Line
temp.txt 5 Line
temp.txt 6 Line
temp.txt 7 Line
temp.txt 8 Line
temp.txt N Line
I expect the output like as below
processing 6 ...
processing 7 ... (6 Replies)
Discussion started by: k_manimuthu
6 Replies
6. Post Here to Contact Site Administrators and Moderators
I have read the sun-expansion scenario numerous places but I've never read any suggestion that the earth's orbit would increase to avoid being scorched. What mechanism would push it out?
As for creating a black hole by the LHC, the whole concept is silly so any number of reasons would rule it... (9 Replies)
Discussion started by: KenJackson
9 Replies
7. Shell Programming and Scripting
Hello Guys,
I request anyone to do me a small help in using diff command for following.
I am trying to compare two files for content and wish to keep the content after the comparison (The resultant file can't be blank)
However, the first lines would be different in both files and I need diff... (2 Replies)
Discussion started by: rockf1bull
2 Replies
8. Shell Programming and Scripting
i have to remove the commented (/* . . . .*/) part which starts in one line and ends in other.help me with generic code because i have 1000 to 10k lines code which i have to remove.
data one;
set work.temp;
input name age;
infile filename;
/* dfsdf
dsfs
sdfdf
dsdd
sdfsf
sdfsf
sfs... (4 Replies)
Discussion started by: saaisiva
4 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am trying to remove multi line and single line comments like examples below
I have tried this pattern. it works fine for single line comments and multi line comments in a single line only. but this fails when the comments are extended in multiple lines as shown in the comment 2 of... (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies
10. SCO
In COBOL, a hyphen can be used in a field name and in a specific program some field names would be identical to others except a suffix was added--sometimes a suffix to a suffix was used. For example, assume I am looking for AAA, AAA-BBB, and AAA-BBB-CCC and don't want to look at AAA-BBB-CCC... (7 Replies)
Discussion started by: wbport
7 Replies
LEARN ABOUT FREEBSD
vgrindefs
VGRINDEFS(5) BSD File Formats Manual VGRINDEFS(5)
NAME
vgrindefs -- language definition data base for vgrind(1)
SYNOPSIS
vgrindefs
DESCRIPTION
The vgrindefs file contains all language definitions for vgrind(1). The data base is very similar to termcap(5).
FIELDS
The following table names and describes each field.
Name Type Description
ab str regular expression for the start of an alternate comment
ae str regular expression for the end of an alternate comment
pb str regular expression for start of a procedure
bb str regular expression for start of a lexical block
be str regular expression for the end of a lexical block
cb str regular expression for the start of a comment
ce str regular expression for the end of a comment
sb str regular expression for the start of a string
se str regular expression for the end of a string
lb str regular expression for the start of a character constant
le str regular expression for the end of a character constant
nc str regular expression for a non-comment (see below)
tl bool present means procedures are only defined at the top lexical level
oc bool present means upper and lower case are equivalent
kw str a list of keywords separated by spaces
Non-comments are required to describe a certain context where a sequence that would normally start a comment loses its special meaning. A
typical example for this can be found in Perl, where comments are normally starting with '#', while the string '$#' is an operator on an
array.
REGULAR EXPRESSIONS
Vgrindefs uses regular expression which are very similar to those of ex(1) and lex(1). The characters `^', `$', `:' and `' are reserved
characters and must be "quoted" with a preceding '' if they are to be included as normal characters. The metasymbols and their meanings
are:
$ the end of a line
^ the beginning of a line
d a delimiter (space, tab, newline, start of line)
a matches any string of symbols (like .* in lex)
p matches any alphanumeric name. In a procedure definition (pb) the string that matches this symbol is used as the procedure name.
() grouping
| alternation
? last item is optional
e preceding any string means that the string will not match an input string if the input string is preceded by an escape character ().
This is typically used for languages (like C) which can include the string delimiter in a string by escaping it.
Unlike other regular expressions in the system, these match words and not characters. Hence something like "(tramp|steamer)flies?" would
match "tramp", "steamer", "trampflies", or "steamerflies".
KEYWORD LIST
The keyword list is just a list of keywords in the language separated by spaces. If the "oc" boolean is specified, indicating that upper and
lower case are equivalent, then all the keywords should be specified in lower case.
FILES
/usr/share/misc/vgrindefs File containing terminal descriptions.
EXAMPLES
The following entry, which describes the C language, is typical of a language entry.
C|c::pb=^d?*?d?pd?(a?):bb={:be=}:cb=/*:ce=*/:sb=":se=e":
:lb=':le=e':tl:
:kw=asm auto break case char continue default do double else enum
extern float for fortran goto if int long register return short
sizeof static struct switch typedef union unsigned while #define
#else #endif #if #ifdef #ifndef #include #undef # define else endif
if ifdef ifndef include undef:
Note that the first field is just the language name (and any variants of it). Thus the C language could be specified to vgrind(1) as "c" or
"C".
Entries may continue onto multiple lines by giving a as the last character of a line. Capabilities in vgrindefs are of two types: Boolean
capabilities which indicate that the language has some particular feature and string capabilities which give a regular expression or keyword
list.
SEE ALSO
troff(1), vgrind(1)
HISTORY
The vgrindefs file format appeared in 4.2BSD.
BSD
June 6, 1993 BSD