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
This commit is contained in:
Mikhail S Medvedev 2015-01-20 11:04:48 -06:00
parent 46d4769f8c
commit fc9cc96514

View File

@ -381,10 +381,10 @@ fi
if [[ -n "$LOGFILE" ]]; then if [[ -n "$LOGFILE" ]]; then
# Clean up old log files. Append '.*' to the user-specified # Clean up old log files. Append '.*' to the user-specified
# ``LOGFILE`` to match the date in the search template. # ``LOGFILE`` to match the date in the search template.
local logfile_dir="${LOGFILE%/*}" # dirname LOGFILE_DIR="${LOGFILE%/*}" # dirname
local logfile_name="${LOGFILE##*/}" # basename LOGFILE_NAME="${LOGFILE##*/}" # basename
mkdir -p $logfile_dir mkdir -p $LOGFILE_DIR
find $logfile_dir -maxdepth 1 -name $logfile_name.\* -mtime +$LOGDAYS -exec rm {} \; find $LOGFILE_DIR -maxdepth 1 -name $LOGFILE_NAME.\* -mtime +$LOGDAYS -exec rm {} \;
LOGFILE=$LOGFILE.${CURRENT_LOG_TIME} LOGFILE=$LOGFILE.${CURRENT_LOG_TIME}
SUMFILE=$LOGFILE.summary.${CURRENT_LOG_TIME} SUMFILE=$LOGFILE.summary.${CURRENT_LOG_TIME}
@ -407,8 +407,8 @@ if [[ -n "$LOGFILE" ]]; then
echo_summary "stack.sh log $LOGFILE" echo_summary "stack.sh log $LOGFILE"
# Specified logfile name always links to the most recent log # Specified logfile name always links to the most recent log
ln -sf $LOGFILE $logfile_dir/$logfile_name ln -sf $LOGFILE $LOGFILE_DIR/$LOGFILE_NAME
ln -sf $SUMFILE $logfile_dir/$logfile_name.summary ln -sf $SUMFILE $LOGFILE_DIR/$LOGFILE_NAME.summary
else else
# Set up output redirection without log files # Set up output redirection without log files
# Set fd 3 to a copy of stdout. So we can set fd 1 without losing # Set fd 3 to a copy of stdout. So we can set fd 1 without losing