Hi,
I need idea about this, say I have this line:
05 21 * * 0,6 /user/clean.desktop.sh > /tmp/desktop_rpt 2>&1
I would need to grep the word desktop and display the /user/clean.desktop.sh and not the whole line. And if I have some more lines say,
05 21 * * 0,6 /user/clean.desktop.sh >... (1 Reply)
Hi,
When we "grep" for a word in a file, it returns the lines containing the word that we searched for. Is there a way to display only the words and not the entire line containing them.
Thanks
Ananth (6 Replies)
Hi Guru's.... I've one log file in all my systems which writes the backup information..
I'have written a command like this:
ssh -l ora${sid} ${primaryhost} "tail -50 /oracle/$ORACLE_SID/newbackup/END_BACKUP.log" |grep 'insert' |tail -1| awk '{print $7}'
We have nearly 50 systems in our... (2 Replies)
Hi,
I'm trying to match records using awk which contain only one occurance of my string, I know how to match one or more (+) but matching only one is eluding me without developing some convoluted bit of code. I was hoping there would be some simple pattern matching thing similar to '+' but... (9 Replies)
Folks, is it possible to display only words with grep (or any built-in ultility)?
I have more than 1 pattern to search, say apple & orange
The text goes like this:
So I need to display all the words starting with apple or orange
The output should be:
Any idea? (7 Replies)
hi, consider the below line in a text file,
'Y',getdate(),'N','V',NULL .....
'N',getdate(),'Y','D',NULL .....
'Y','N','Y',getdate(),'Y','D',NULL ....
as u see above, i want only the second word after the getdate() word...
getdate() will not come 2nd word alwys it may be any position but i... (11 Replies)
Hi!
I'm trying to create a shell script to parse a file which might have multiple lines matching a pattern (i.e. containing some word).
I need to return all lines matching the pattern, but stripping the contents of that line until the pattern is matched
For example, if my input file was
... (4 Replies)
Hello Gurus,
Apologies if this Q has been repeated but i was not able to find it :(
I have an input file:
-------------------------------
Replace DB.Employee
as
select
column1
column2
from DB_T.Emp
and DB.Test
and
DB.Dept
and
DB_T.Ter;
------------------------ (4 Replies)
Hi Guys,
I am new to awk and sed, i am working multiline document, i want to make make that document into SINGLE lines based on occurace of string "dwh".
here's the sample of my problem..
dwh123 2563 4562 4236 1236 78956 12394 4552 dwh192 2656 46536 231326 65652 6565 23262 16625623... (5 Replies)
Hi,
When we "grep" for a word in a file, it returns the last lines containing the word that we searched for.
Is there a way to display last line to grep.
Thanks
Ex log.
Ex. logname.log
2015-07-29 06:43:07.023|BETA |2015-07-29... (5 Replies)
Discussion started by: ooilinlove
5 Replies
LEARN ABOUT LINUX
look
LOOK(1) BSD General Commands Manual LOOK(1)NAME
look -- display lines beginning with a given string
SYNOPSIS
look [-bdf] [-t termchar] string [file ...]
DESCRIPTION
The look utility displays any lines in file which contain string as a prefix.
If file is not specified, the file /usr/share/dict/words is used, only alphanumeric characters are compared and the case of alphabetic char-
acters is ignored.
The following options are available:
-b Use a binary search on the given word list. If you are ignoring case with -f or ignoring non-alphanumeric characters with -d, the
file must be sorted in the same way. Please note that these options are the default if no filename is given. See sort(1) for more
information on sorting files.
-d Dictionary character set and order, i.e., only alphanumeric characters are compared.
-f Ignore the case of alphabetic characters.
-t Specify a string termination character, i.e., only the characters in string up to and including the first occurrence of termchar are
compared.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of the look utility. Their effect is described in environ(7).
FILES
/usr/share/dict/words the dictionary
EXIT STATUS
The look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred.
COMPATIBILITY
The original manual page stated that tabs and blank characters participated in comparisons when the -d option was specified. This was incor-
rect and the current man page matches the historic implementation.
look uses a linear search by default instead of a binary search, which is what most other implementations use by default.
SEE ALSO grep(1), sort(1)HISTORY
A look utility appeared in Version 7 AT&T UNIX.
BUGS
Lines are not compared according to the current locale's collating order. Input files must be sorted with LC_COLLATE set to 'C'.
BSD July 17, 2004 BSD