File: match

package info (click to toggle)
shc 3.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 208 kB
  • ctags: 104
  • sloc: ansic: 1,121; makefile: 93; sh: 28; sed: 12; csh: 2
file content (24 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# File search script by <workexp@csc.liv.ac.uk>
# Usage: match [Filename]
#
IFS=":$IFS"

for substring in $@
do
  for path in $PATH
  do
    for command in $path/*$substring*
    do
      if [ -f $command ]
      then
        echo $command
      fi
    done
  done
done

# Added
echo "[$$] PAUSED... Hit return!"
read DUMMY