Operating System - Linux
1752608 Members
4080 Online
108788 Solutions
New Discussion юеВ

Exact pattern matching in script

 
SOLVED
Go to solution
Gordon_3
Regular Advisor

Exact pattern matching in script

Hi all,

If I have below output line after running the cmd, how can I get exactly the first line, pls note there is a tricky thing that the first line, after backup, has "variable" space on that.... Thx.

Bgds,
Gordon


1% ( 0%) 0% ( 0%) Apr 19 19:04 backup
3% ( 0%) 1% ( 0%) Apr 19 19:05 backup.May05
Gordon
2 REPLIES 2
RAC_1
Honored Contributor
Solution

Re: Exact pattern matching in script

grep -w backup "your_file"

cmd | grep -w 'backup'
There is no substitute to HARDWORK
Gordon_3
Regular Advisor

Re: Exact pattern matching in script

Hi,

Thx for that, it rocks !

Bgds,
Gordon
Gordon