![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep with variable | ozvena | Shell Programming and Scripting | 5 | 05-14-2008 04:05 PM |
| question on sed grep awk from variable | 3Gmobile | Shell Programming and Scripting | 9 | 08-11-2006 01:15 AM |
| define length of variable | cbarker | UNIX for Dummies Questions & Answers | 10 | 04-01-2005 01:42 PM |
| How to grep a variable? | whatisthis | Shell Programming and Scripting | 2 | 09-14-2004 07:26 PM |
| How to define two variable in foreach command?? | geoquest | Shell Programming and Scripting | 14 | 08-22-2002 07:11 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Using Grep to Define a Variable
I am using korn shell unix.
I have a script that I am working with to do a check for me using a text file. #finds "Time" from the text file and cuts the second field from the #line A= grep Time test.txt | cut -f2 # the "#Missing" is being pulled from the second field of the text #file if [ "$A" = #Missing ] then echo "page me" fi My problem is that I am unable to get the 'echo "page me"' to echo back onto the screen. This tells me that the check isn't successful- or at least that is what I think it is telling me. My if statement may be incorrect- I've tried '-eq', but no luck there either. I'm also not certain if I can use grep to try and define a variable. I've even attempted to use awk. Everything works on the command line, by itself (like running the grep command). Anyone have any ideas? I'm pretty new at Unix. Thanks, Chris |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|