mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
22 lines
286 B
Bash
Executable File
22 lines
286 B
Bash
Executable File
#!/bin/bash
|
|
|
|
EXEC=""
|
|
TARGET="bin"
|
|
declare -A PARAMS
|
|
declare -i INDEX=0
|
|
|
|
for e in $@; do
|
|
TARGET="$TARGET/$e"
|
|
PARAMS[$INDEX]=$e
|
|
INDEX=$INDEX+1
|
|
shift
|
|
if [ -x "${TARGET}.sh" ]; then
|
|
EXEC="${TARGET}.sh"
|
|
PARAMS=()
|
|
INDEX=0
|
|
fi
|
|
done
|
|
|
|
echo ">> $EXEC"
|
|
exec "$EXEC" $PARAMS
|