Sponsored Content
Full Discussion: Find Exact word in file
Top Forums Shell Programming and Scripting Find Exact word in file Post 302238441 by Jeevan Salunke on Saturday 20th of September 2008 03:53:51 AM
Old 09-20-2008
Question Find Exact word in file

Hi ALL,

I want to search one string “20 “ i.e 20 with space.
But my file where I am searching this “20 “ contain some data like

120 before image file truncated
220 Reports section succeeded
20 Transaction database .prd stopped
220 Reports section completed.

When I search for the string “20 “ it give me all data like

120 before image file truncated
220 Reports section succeeded
20 Transaction database .prd stopped
220 Reports section completed.

I want output only this line.

20 Transaction database .prd stopped

I don't want other lines.
Please suggest some code. I am using Ksh.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find the exact pattern from a file?

Hi Let say there is a file a.txt which contain number rows. My intention is to find the number of occurences of a pattern. Let say the pattern is mdbase. then it should not count the occurences of mdbase1 or mdbase2 like this. When I tried to find it like grep "/backup/surjya/mdbase"... (7 Replies)
Discussion started by: surjyap
7 Replies

2. Shell Programming and Scripting

find a word in a file, and change a word beneath it ??

Hi all, I have a file with lines written somewhat like this. aaaa ccc aa linux browse = no xssxw cdcedc dcsdcd csdw police dwed dwd browse = no cdecec (2 Replies)
Discussion started by: vikas027
2 Replies

3. UNIX for Dummies Questions & Answers

How to find exact text in file ?

I have file named shortlist , and it contains this: 2233|charles harris |g.m. |sales |12/12/52| 90000 9876|bill johnson |director |production|03/12/50|130000 5678|robert dylan |d.g.m. |marketing |04/19/43| 85000 2365|john woodcock |director |personnel... (1 Reply)
Discussion started by: Cecko
1 Replies

4. Shell Programming and Scripting

Find file with exact access date

Hi I have to write command that find the files/dirs in the directory with access date equal to timestamp. ie or to be more precise I need to find files which are not equal to given timestamp drwxr-xr-x 2 oracle oinstall 4096 May 31 2007 tmp so need to have something like find . *... (2 Replies)
Discussion started by: zam
2 Replies

5. Shell Programming and Scripting

to get the exact word from the file using script

Hi everybody, I have one requirment, i have to get the particular server name from a file. EX: File contents will be like below.. $cat test.txt HostAssignments->new("server1", [ "PS_SERVER", "REG_SERVER", "PS_ORACLE", "OM_G10_AUD", "OM_G10_CAD", "OM_G10_CHF", ... (3 Replies)
Discussion started by: raghu.iv85
3 Replies

6. UNIX for Advanced & Expert Users

Find exact path of a file/directory

Hello Folks, A wrapper takes an argument of file or directory name. I want to allow paths that reside within the current directory only. Can simply discard the paths like "/A" & "../" as they go outside the current by looking at the path beginning. How to validate this one: A/../../../b... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

7. UNIX for Dummies Questions & Answers

How to find a file if we dont know exact location of file ?

Hi I want know "How to find a file if we dont know exact location of file ?" Thanks, Tushar Joshi:) (9 Replies)
Discussion started by: tusharjoshi
9 Replies

8. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

9. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

10. Shell Programming and Scripting

Grep Exact word

This may be stupid question but not able to solve it. How to grep exact word and line along with it. TEST:/u00/app/oracle/product/10.2.0/TEST:N TEST2:/u00/app/oracle/product/10.2.0/ODS:N TEST3:/u00/app/oracle/product/10.2.0/TEST:N TEST4:/u00/app/oracle/product/10.2.0/ODS:N... (4 Replies)
Discussion started by: tapia
4 Replies
ncurses5.4-config(1)					    BSD General Commands Manual 				      ncurses5.4-config(1)

NAME
ncurses5.4-config -- report configuration and linking information for ncurses SYNOPSIS
ncurses5.4-config {--prefix | --exex-prefix | --cflags | --libs | --version | --abi-version | --mouse-version | --bindir | --datadir | --lib- dir | --mandir | --terminfo | --terminfo-dirs | --termpath } DESCRIPTION
The ncurses5.4-config utility reports ncurses configuration and linking information. The options are as follows: ---prefix Reports package-prefix ncurses5.4-config was installed with ---exec-prefix Reports executable-prefix ncurses5.4-config was installed with ---cflags Reports C compiler flags needed to compile with ncurses ---libs Reports libraries needed to link with ncurses ---version Reports release+patchdate version ncurses5.4-config was installed with ---abi-version Reports ABI version ncurses5.4-config was installed with ---mouse-version Reports mouse-interface version ncurses5.4-config was installed with ---bindir Reports directory containing ncurses5.4-config programs ---datadir Reports directory containing ncurses5.4-config data ---libdir Reports directory containing ncurses5.4-config libraries ---mandir Reports directory containing ncurses5.4-config manpages ---terminfo Reports $TERMINFO terminfo database path ---terminfo-dirs Reports $TERMINFO_DIRS directory list ---termpath Reports $TERMPATH termcap list EXIT STATUS
The ncurses5.4-config utility exits 0 on success, and >0 if an error occurs. BSD
January 13, 2009 BSD
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy