File: match

package info (click to toggle)
shc 4.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 560 kB
  • sloc: sh: 1,326; ansic: 1,245; makefile: 13; csh: 2
file content (24 lines) | stat: -rw-r--r-- 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