log-tool.sh

#!/bin/ksh

#usage=log-tool.sh rm -s server1 -t datanode

command="$1";
shift

server=
type=

while getopts t:s: OPTS
do
    case ${OPTS} in        
		s) export server=${OPTARG};;	
        t) export type=${OPTARG};;				
    esac
done

echo $command;
echo $server;
echo $type;

usage="clean|cat|less|tail|rm"

cd $HADOOP_HOME/logs
log_file="hadoop-hduser.$server.$type.log"
echo $log_file;

你可能感兴趣的:(log-tool.sh)