import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
3729fc68eb
commit
423ba10303
13396 changed files with 269468 additions and 0 deletions
25
software/cinit/browse_source/cinit-0.2.1/bin/cinit.path-find
Normal file
25
software/cinit/browse_source/cinit-0.2.1/bin/cinit.path-find
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius
|
||||
# cinit: find binary in path
|
||||
# Date: 2005-10-15
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$(basename $0): searched binary"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
binary=$1
|
||||
|
||||
# this is NOT really clean, paths can also contain spaces
|
||||
for pfad in $(echo $PATH | sed 's/:/ /g'); do
|
||||
fullname=$pfad/$binary
|
||||
if [ -f "$fullname" ]; then
|
||||
echo "$fullname"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue