4 # @(#) corename.ksh 1.0 93/04/01
5 # 92/11/11 john h. dubois iii (john@armory.com)
6 # 92/02/16 Added help option.
7 # 92/02/22 Added cd to origdir to fix prob w/multiple relative paths.
8 # 93/04/01 Added check for whether file exists.
10 # conversion to bash v2 syntax done by Chet Ramey
12 # inspired by belal's equivalent utility
14 if [ "$1" = -h ]; then
16 "$0: print the names of executables that dumped core.
17 Usage: $0 [corename ...]
18 If no corename is given, \"core\" is assumed."
22 [ $# = 0 ] && set core
28 [ -z "$dir" ] && dir
=$origdir/
29 if [ ! -f $dir$file ]; then
30 echo "$dir$file: No such file."
33 if [ ! -r $dir$file ]; then
34 echo "$dir$file: Cannot open."
39 # the adb output syntax is highly variable. this works on SunOS 4.x
40 set -- $
(adb
$file < /dev
/null
2>&1 |
sed 1q
)