Script header bash to reorder cygwin binary execution files as priority

#!/usr/bin/env bash

# install variant debug and start activity

(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix

# absolute path working directory
basecwd=${PWD}
# base script directory
basedir=`dirname "$0"`
# absolute path script directory
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

case `uname` in
  *CYGWIN*)
    basedir=`cygpath -w "$basedir"`
    # make cygwin bin as priority
    export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH"
    ;;
esac

# YOUR CODES

Script header bash to acquire sudo previlege

#!/usr/bin/env bash

# install variant debug and start activity

(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix

# absolute path working directory
basecwd=${PWD}
# base script directory
basedir=`dirname "$0"`
# absolute path script directory
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

case `uname` in
  *CYGWIN*)
    basedir=`cygpath -w "$basedir"`
    # make cygwin bin as priority
    export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH"
    ;;
esac

SUDO_CMD=""
if [ "$USER" != "root" ]; then
  SUDO_CMD="sudo "
fi

$SUDO_CMD echo "sudo granted"

# YOUR CODES