|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Read complete line
Hello all,
I have following line and want to search the exact match in text file. 30 6 * * * /data/abc/abc.ksh -f xya.sql -xyz@email -x -c -g I have tried it many ways like grep -W ,sed,etc.... but could not find the solution. The above line i am storing it in one variable called "var" and evertime i will have different line in this variable.Can you please help me in this?? |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try: Code:
var='30 6 * * * /data/abc/abc.ksh -f xya.sql -xyz@email -x -c -g' grep -F -- "$var" file |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks for your reply But at my end -F is not working..
![]() is there any other alternative? |
|
#4
|
||||
|
||||
|
Are you using Solaris? Try: Code:
/usr/xpg4/bin/grep -F -- "$var" file or otherwise try: Code:
fgrep -- "$var" file |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Thanks a ton!!!!
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash: read file line by line (lines have '\0') - not full line has read??? | alex_5161 | Shell Programming and Scripting | 6 | 04-14-2010 04:58 AM |
| Reading complete line after spaces | gupt_ash | Shell Programming and Scripting | 8 | 12-14-2009 03:17 PM |
| Split a line on positions before reading complete line | vijaykrc | Shell Programming and Scripting | 1 | 02-18-2009 06:23 PM |
| Delete a word and complete line | Aejaz | UNIX for Advanced & Expert Users | 1 | 05-02-2008 12:50 PM |
| Using the Esc key to complete command line typing | jxh461 | UNIX for Dummies Questions & Answers | 1 | 06-05-2007 06:04 PM |
|
|