From fc9cc96514bf582d644029f114441891a087d665 Mon Sep 17 00:00:00 2001 From: Mikhail S Medvedev Date: Tue, 20 Jan 2015 11:04:48 -0600 Subject: [PATCH] Remove locals that were not inside functions Using 'local' keyword outside a function is invalid. Also uppercase the variables to adhere to the style. Related: I02aba9ca82c117a1186dafc1d3c07aa04ecd1dde Change-Id: I76d358f8ebf5145cd3c65f9a470c83d4af67fd32 --- stack.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stack.sh b/stack.sh index 00a617253e..aeaaf6072c 100755 --- a/stack.sh +++ b/stack.sh @@ -381,10 +381,10 @@ fi if [[ -n "$LOGFILE" ]]; then # Clean up old log files. Append '.*' to the user-specified # ``LOGFILE`` to match the date in the search template. - local logfile_dir="${LOGFILE%/*}" # dirname - local logfile_name="${LOGFILE##*/}" # basename - mkdir -p $logfile_dir - find $logfile_dir -maxdepth 1 -name $logfile_name.\* -mtime +$LOGDAYS -exec rm {} \; + LOGFILE_DIR="${LOGFILE%/*}" # dirname + LOGFILE_NAME="${LOGFILE##*/}" # basename + mkdir -p $LOGFILE_DIR + find $LOGFILE_DIR -maxdepth 1 -name $LOGFILE_NAME.\* -mtime +$LOGDAYS -exec rm {} \; LOGFILE=$LOGFILE.${CURRENT_LOG_TIME} SUMFILE=$LOGFILE.summary.${CURRENT_LOG_TIME} @@ -407,8 +407,8 @@ if [[ -n "$LOGFILE" ]]; then echo_summary "stack.sh log $LOGFILE" # Specified logfile name always links to the most recent log - ln -sf $LOGFILE $logfile_dir/$logfile_name - ln -sf $SUMFILE $logfile_dir/$logfile_name.summary + ln -sf $LOGFILE $LOGFILE_DIR/$LOGFILE_NAME + ln -sf $SUMFILE $LOGFILE_DIR/$LOGFILE_NAME.summary else # Set up output redirection without log files # Set fd 3 to a copy of stdout. So we can set fd 1 without losing