[lug] regular expression question (SOLVED)
Kevin Kempter
kevin at kevinkempterllc.com
Tue Dec 4 10:14:10 MST 2007
On Tuesday 04 December 2007 10:05:09 you wrote:
> I think that means either a literal '$', or in regexp-land, a '$' means
> the end of line. However, since it's escaped ('\$'), it probably just
> means that it's trying to find (or since using 'grep -v', more like
> ignoring) the dollar-sign.
>
> - Steve
Just FYI:
The '/$' looks for a fwd slash at the end of a line. So, since the ls -1tp in
the original line returns all directory names followed by a slash the command
returns the most recent file but excludes directory names
ls -1tp | grep -v '/$' | head -1
More information about the LUG
mailing list