Re: files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-11-30 at 02:22 +1030, Tim wrote:
> Jacques B.:
> >> grep -ir "^put sentence here$" *
> 
> Ingemar Nilsson:
> > Note that this will only match if the sentence is on a line by itself,
> > since ^ and $ means beginning of line and end of line respectively.
> 
> Are you sure about that?  I thought they just meant that the string
> begins with, and ends with, the enclosed characters.  I didn't think
> they actually refered to end-of-line indicators, the same markers are
> used in wildcarding where there isn't a notion of "lines" (e.g. URIs).
> 
Using a URI is not the same as having the bash shell interpret the
command line.
In bash (and regexes) in the format used above the ^ literally means
"line begins with" and the $ means "line ends with"

To have it match anywhere in the line you must remove those special
characters.

Try it yourself if you need proof.
 
> -- 
> (Currently testing FC5, but still running FC4, if that's important.)
> 
> Don't send private replies to my address, the mailbox is ignored.
> I read messages from the public lists.
> 

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux