(fwd) Re: shell script

Andrey Gerzhov (kittle@freeland.alex-ua.com)
Sat, 1 May 1999 17:04:28 +0300 (EEST)

-- forwarded message --
Path: freeland.alex-ua.com!routki.ki.yurteh.net!carrier.kiev.ua!srcc!news1.gamma.ru!newsfeed.gamma.ru!Gamma.RU!ddt.demos.su!not-for-mail
From: Mikhail Khlopovskikh <hlop@tspace.ru>
Newsgroups: fido7.ru.unix.bsd
Subject: Re: shell script
Date: 29 Apr 1999 13:20:32 +0400
Organization: TSC
Lines: 20
Sender: fido7@ddt.demos.su
Approved: <gateway@fido7.ru>
Message-ID: <372823DD.77CA5E72@tspace.ru>
References: <199904290618.KAA16653@mix.nordlink.ru>
NNTP-Posting-Host: ddt.demos.su
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Trace: ddt.demos.su 925377634 27269 194.87.13.37 (29 Apr 1999 09:20:34 GMT)
X-Complaints-To: gatekeeper@fido7.ru
NNTP-Posting-Date: 29 Apr 1999 09:20:34 GMT
X-BeforeModerator-Path: usenet
X-BeforeModerator-NNTP-Posting-Host: hlop.tspace.ru
X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.1-RELEASE i386)
X-Accept-Language: Russian, ru, en
Xref: freeland.alex-ua.com fido7.ru.unix.bsd:7130

Michael Kichanov wrote:

> : Пипл, ну причем тут find? Человек задал простой вопрос.
> : Решение тоже простое:
> : #!/bin/sh
> : [ -f /home/user/abcd.??? ] && echo Yes || echo NO
> : Конечно с одним ограничением - '*' не работает :(
>
> ить вроде про маску `*' спрашивалось?
> вот другой вариант:
>
> set - /usr/xxx/xxx.*; [ -f $1 ] && your_handle_stuff

Точно! И еще вместо -f можно использовать -s - та самая ненулевая
длинна. И не надо заморачиваться всякими перлами, авками и прочими
дополнительными нагрузками там где можно наити более простой и
красивый вариант. Соответственно, в csh юзаем
setenv - /usr/xxx/xxx.*; [ -s $1 ] && your_handle_stuff

Михаил
-- end of forwarded message --

-- 
С тем, что не помешает никогда,
                                               Kittle