Sponsored Content
Full Discussion: Grep reg. express problem
Top Forums UNIX for Advanced & Expert Users Grep reg. express problem Post 302895119 by wbport on Friday 28th of March 2014 02:07:08 PM
Old 03-28-2014
Grep reg. express problem

When in the vi editor, I can find where the value of variables in COBOL programs (everything is uppercase) get changed with
Code:
/[NOTEP][EGMOT]  *ACCT-BALANCE

and it will find the last two characters of reserved words such as ACCEPT, FROM, TO, and COMPUTE followed by at least one space before the variable I'm looking for.
Running something similar through grep such as
Code:
grep "[NOTEP][EGMOT]  *ACCT-BALANCE" *.CBL

would display all occurrences of ACCT-BALANCE with or without a keyword or leading space (BACCT-BALANCE for example). In both cases, there are two spaces before the asterisk.

What am I missing?

TIA
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SCO vs Linux Reg Expressions Problem

Hi there, I'm investigating migrating a system currently running Scos osr5 to Linux (eg RH 7.2) but there are a lot of in house scripts, some of which are probably using "Sco specific" constructs etc. One I have come across is as follows, if ????? ] then ....etc.etc fi The regular... (2 Replies)
Discussion started by: pcs7088
2 Replies

2. Shell Programming and Scripting

grep problem

cat *:22:B0 has the following output 2220 -50 2220 -50 2220 -51 2225 -47 2225 -50 2230 -63 2230 -50 2235 -50 2235 -50 2235 -48 2240 -53 2240 -53 2245 -51 2245 -51 2250 -52 2250 -52 2250 -50 (2 Replies)
Discussion started by: yogesh_powar
2 Replies

3. UNIX for Dummies Questions & Answers

reg putty problem

Hi, i am using PUTTY 0.51 release for connecting the Red hate linux box in SSH mode. its working fine but i can't able to scoll the scoll bar using scroll wheel inthe mouse. please suggest me how to solve it. thanks in advance. thanks and regards, ilayans (2 Replies)
Discussion started by: ilayans
2 Replies

4. Shell Programming and Scripting

HowTo: reg expr doing grep "timestamp>$DesiredTime" logfile ?

I know I asked a similar question but I want to know if there is a regular expression existing that with a korn shell cmd, finds any timestamp data records in a file where it is greater then a timestamp in a shell variable ? something like : grep all records where it has a timestamp >... (5 Replies)
Discussion started by: Browser_ice
5 Replies

5. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

6. Shell Programming and Scripting

Awk problem: How to express the backtick(')

For example: I got a list of file end at .txt. I want all of them do the same command like grep '^@' and attached it to a output .sh file. This is the command I type: ls *.txt | awk '{print "grep \' \^\@\' ",$1}' > txt.sh My desired output is when I type the command "more txt.sh " The... (4 Replies)
Discussion started by: patrick87
4 Replies

7. UNIX for Advanced & Expert Users

reg problem deleting file

hi, 1. When i am deleting file in the linux machine i am getting below error message. rm text.fil rm: remove regular file `text.fil'? y rm: cannot remove `text.fil': Read-only file system From su also i tried i am getting same error message. 2. Some times the file permissions and user name... (1 Reply)
Discussion started by: coconut.ramu
1 Replies

8. Shell Programming and Scripting

Grep problem

i have a log file...in that there is a data like oss1 F:\app\data\misc\server 012-07-31 08:35:15 8.1.1. oss2 F:\app\data\misc\server 012-07-31 08:36:15 8.1.2. oss3 F:\app\data\misc\server 012-07-31 08:37:15 8.1.3. pss4 F:\app\data\misc\server 012-07-31... (20 Replies)
Discussion started by: navsan420
20 Replies

9. UNIX for Dummies Questions & Answers

Grep Problem

Dear all, my question is about grep. i have two files. the first one is a list with ids (line number 188) like this: comp10045_c0_seq1 comp10118_c0_seq1 comp10221_c0_seq2 comp10503_c0_seq1 comp10504_c0_seq1 comp10504_c0_seq2 comp10631_c0_seq1 comp10631_c0_seq2 comp10646_c0_seq1... (17 Replies)
Discussion started by: kleinstadt
17 Replies

10. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies
TABS(1) 						    BSD General Commands Manual 						   TABS(1)

NAME
tabs -- set terminal tabs SYNOPSIS
tabs [-n | -a | -a2 | -c | -c2 | -c3 | -f | -p | -s | -u] [+m[n]] [-T type] tabs [-T type] [+[n]] n1[,n2,...] DESCRIPTION
The tabs utility displays a series of characters that clear the hardware terminal tab settings then initialises tab stops at specified posi- tions, and optionally adjusts the margin. In the first synopsis form, the tab stops set depend on the command line options used, and may be one of the predefined formats or at regular intervals. In the second synopsis form, tab stops are set at positions n1, n2, etc. If a position is preceded by a '+', it is relative to the previous position set. No more than 20 positions may be specified. If no tab stops are specified, the ``standard'' UNIX tab width of 8 is used. The options are as follows: -n Set a tab stop every n columns. If n is 0, the tab stops are cleared but no new ones are set. -a Assembler format (columns 1, 10, 16, 36, 72). -a2 Assembler format (columns 1, 10, 16, 40, 72). -c COBOL normal format (columns 1, 8, 12, 16, 20, 55) -c2 COBOL compact format (columns 1, 6, 10, 14, 49) -c3 COBOL compact format (columns 1, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 67). -f FORTRAN format (columns 1, 7, 11, 15, 19, 23). -p PL/1 format (columns 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61). -s SNOBOL format (columns 1, 10, 55). -u Assembler format (columns 1, 12, 20, 44). +m[n], +[n] Set an n character left margin, or 10 if n is omitted. -T type Output escape sequence for the terminal type type. ENVIRONMENT
The LANG, LC_ALL, LC_CTYPE and TERM environment variables affect the execution of tabs as described in environ(7). The -T option overrides the setting of the TERM environment variable. If neither TERM nor the -T option are present, tabs will fail. EXIT STATUS
The tabs utility exits 0 on success, and >0 if an error occurs. SEE ALSO
expand(1), stty(1), tput(1), unexpand(1), termcap(5) STANDARDS
The tabs utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A tabs utility appeared in PWB UNIX. This implementation was introduced in FreeBSD 5.0. BUGS
The current termcap(5) database does not define the 'ML' (set left soft margin) capability for any terminals. BSD
May 20, 2002 BSD
All times are GMT -4. The time now is 01:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy