Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: Re: grep-ing for "*" with SKsh Message-ID: <13920075@hpfelg.HP.COM> Date: 18 Jul 90 01:31:16 GMT References: Organization: HP Elec. Design Div. -FtCollins Lines: 18 Earlier I wrote this: > The problem with using "grep" to search for the '*' is that the '*' > is a "special" regular expression character meaning "0 or more of the > previous expression". It is also a special character to the shell, > used in pattern matching. You must escape both of these to use the > '*' with grep. Fgrep is easier. If you normally find yourself > using fgrep instead of grep, you can alias one to the other. I forgot to include the exact command line to grep: grep '\\*' myfile The first backslash escapes the second in SKsh. Then, a single backslash gets passed to grep which grep uses to escape the '*' which is a special character. - steve