home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume26
/
cook-1.4
/
part01
/
test
/
00
/
t0035a.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
1993-05-03
|
1KB
|
58 lines
#! /bin/sh
#
# cook - file construction tool
# Copyright (C) 1990, 1991, 1992, 1993 Peter Miller.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# MANIFEST: test the %0 pattern, it must not match absolute paths
#
tmp=/tmp/$$
here=`pwd`
fail()
{
echo 'FAILED test of the "%0" pattern' 1>&2
cd $here
rm -rf $tmp
exit 1
}
pass()
{
cd $here
rm -rf $tmp
exit 0
}
trap "fail" 1 2 3 15
mkdir $tmp
cd $tmp
cat > Howto.cook << 'foobar'
test:
{
if [match_mask %0%1 /foo/bar] then fail;
if [not [match_mask /%0%1 /foo/bar ]] then fail;
}
foobar
if test $? -ne 0 ; then fail; fi
$here/bin/cook -nl
if test $? -ne 0 ; then fail; fi
# probably OK
pass