MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/share/doc/bash-3.1/scripts.v2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/doc/bash-3.1/scripts.v2/corename
#! /bin/bash
#
# original from:
# @(#) corename.ksh 1.0 93/04/01
# 92/11/11 john h. dubois iii (john@armory.com)
# 92/02/16 Added help option.
# 92/02/22 Added cd to origdir to fix prob w/multiple relative paths.
# 93/04/01 Added check for whether file exists.
#
# conversion to bash v2 syntax done by Chet Ramey

# inspired by belal's equivalent utility

if [ "$1" = -h ]; then
    echo \
"$0: print the names of executables that dumped core.
Usage: $0 [corename ...]
If no corename is given, \"core\" is assumed."
    exit 0
fi

[ $# = 0 ] && set core
origdir=$PWD
for i; do
    cd $origdir
    file=${i##*/}
    dir=${i%$file}
    [ -z "$dir" ] && dir=$origdir/
    if [ ! -f $dir$file ]; then
	echo "$dir$file: No such file."
	continue
    fi
    if [ ! -r $dir$file ]; then
	echo "$dir$file: Cannot open."
	continue
    fi
    cd $dir

    # the adb output syntax is highly variable.  this works on SunOS 4.x
    set -- $(adb $file < /dev/null 2>&1 | sed 1q)
    name=${7#??}
    echo "$i: ${name%??}"
done

Anon7 - 2021