[CentOS] question on cut

Fri Sep 2 20:35:52 UTC 2005
John Allen <john.allen at dublinux.net>

On Friday 02 September 2005 15:00, Jerry Geis wrote:
> I am trying to use cut to tell me the suffix of a file.
> for example: echo /home/silentm/log/file.machine.log | cut -d . -f 1-
>

Bad to use but it would be 3-, not 1-

> I was expecting to get .log or log but I get the entire string echoed back.
>
> doing the opposite gave me what I expected:
> echo /home/silentm/log/file.machine.log | cut -d . -f 1
> gives me
> /home/silentm/log/file
>
> I am trying to find a way to test if the file ends in .log?
>
> How might I do that.
>
> Thanks,
>
> Jerry
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

-- 
John Allen,                          mailto:john.allen at dublinux.net
MandrakeClub Silver Member.          http://www.dublinux.net

Site of the day: http://www.kde.ie/

Mandrakelinux release 10.2 (Cooker) for i586, kernel 2.6.11-6mdk
 21:35:23 up  1:18,  3 users,  load average: 0.02, 0.07, 0.02