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) 						      General Commands Manual							   tabs(1)

NAME
tabs - set tabs on a terminal SYNOPSIS
tabs [-v[n]] [-ahuUV] file... DESCRIPTION
The tabs program clears and sets tab-stops on the terminal. This uses the terminfo clear_all_tabs and set_tab capabilities. If either is absent, tabs is unable to clear/set tab-stops. The terminal should be configured to use hard tabs, e.g., stty tab0 OPTIONS
General Options -Tname Tell tabs which terminal type to use. If this option is not given, tabs will use the $TERM environment variable. If that is not set, it will use the ansi+tabs entry. -d The debugging option shows a ruler line, followed by two data lines. The first data line shows the expected tab-stops marked with asterisks. The second data line shows the actual tab-stops, marked with asterisks. -n This option tells tabs to check the options and run any debugging option, but not to modify the terminal settings. The tabs program processes a single list of tab stops. The last option to be processed which defines a list is the one that determines the list to be processed. Implicit Lists Use a single number as an option, e.g., "-5" to set tabs at the given interval (in this case 1, 6, 11, 16, 21, etc.). Tabs are repeated up to the right margin of the screen. Explicit Lists An explicit list can be defined after the options (this does not use a "-"). The values in the list must be in increasing numeric order, and greater than zero. They are separated by a comma or a blank, for example, tabs 1,6,11,16,21 tabs 1 6 11 16 21 Use a '+' to treat a number as an increment relative to the previous value, e.g., tabs 1,+5,+5,+5,+5 which is equivalent to the 1,6,11,16,21 example. Predefined Tab-Stops X/Open defines several predefined lists of tab stops. -a Assembler, IBM S/370, first format -a2 Assembler, IBM S/370, second format -c COBOL, normal format -c2 COBOL compact format -c3 COBOL compact format extended -f FORTRAN -p PL/I -s SNOBOL -u UNIVAC 1100 Assembler PORTABILITY
X/Open describes a +m option, to set a terminal's left-margin. None of the entries in the terminal database provide this capability. The -d (debug) and -n (no-op) options are extensions not provided by other implementations. Documentation for other implementations states that there is a limit on the number of tab stops. While some terminals may not accept an arbitrary number of tab stops, this implementation will attempt to set tab stops up to the right margin of the screen, if the given list happens to be that long. SEE ALSO
tset(1), infocmp(1), ncurses(3NCURSES), terminfo(5). This describes ncurses version 5.7 (patch 20100109). tabs(1)
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy