![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| long process listing with /usr/ucb/ps weird behaves | sreeniatbp | Shell Programming and Scripting | 6 | 06-10-2009 08:07 AM |
| listing directories alone | bbala | Shell Programming and Scripting | 2 | 08-03-2008 05:15 AM |
| listing of directories with / at end...without ls -F | vasanthan | UNIX for Dummies Questions & Answers | 10 | 04-16-2008 05:34 AM |
| Listing directories and ${1:+$1/}* | GMMike | UNIX for Dummies Questions & Answers | 5 | 01-24-2005 09:38 PM |
| long listing of files up to a given date | rlh | UNIX for Dummies Questions & Answers | 2 | 10-27-2000 10:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
grep/matching help with long listing of directories
How do I get this to work? Code:
cat somefile | grep "-rw-r--r-- 1 root wheel 287 Sep 10 15:12 shells~" This is the the desired output Code:
-rw-r--r-- 1 root wheel 287 Sep 10 15:12 shells~ I basically want an exact match of the line I am grepping for, the special characters and spaces are giving me errors. Or is there another method I could use? |
|
||||
|
Quote:
Remember, whenever you write 'cat filename | command' you can almost almost always rewrite this in a simpler way as 'command < filename'.I'm guessing(since you didn't say) that it's complaining about bad parameters. It thinks your string is a switch since it starts with -. If you want to tell grep that the following option is a parameter and not a switch, you can add -- before it. Code:
grep -- "-rw-r--r-- 1 root wheel 287 Sep 10 15:12 shells~" < filename Last edited by Corona688; 10-02-2009 at 02:08 PM.. |
| Bits Awarded / Charged to Corona688 for this Post | |||
| Date | User | Comment | Amount |
| 10-02-2009 | thegeek | Nice | 500 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|