1#!/bin/sh 2 3# Dirmatch - take in standard input a list of directory name patterns, 4# then print the matches of the directory names from each item in the list. 5 6# 7# This is part of SLOCCount, a toolsuite that counts 8# source lines of code (SLOC). 9# Copyright (C) 2001-2004 David A. Wheeler. 10# 11# This program is free software; you can redistribute it and/or modify 12# it under the terms of the GNU General Public License as published by 13# the Free Software Foundation; either version 2 of the License, or 14# (at your option) any later version. 15# 16# This program is distributed in the hope that it will be useful, 17# but WITHOUT ANY WARRANTY; without even the implied warranty of 18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19# GNU General Public License for more details. 20# 21# You should have received a copy of the GNU General Public License 22# along with this program; if not, write to the Free Software 23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24# 25# To contact David A. Wheeler, see his website at: 26# http://www.dwheeler.com. 27# 28# 29 30 31while read line 32do 33 echo 34 echo "=== $line ===" 35 ls -1 | grep -i "$line" 36done 37 38