Page MenuHomePhabricator
Paste P12910

bashisms
ActivePublic

Authored by Dzahn on Oct 3 2020, 12:47 AM.
Tags
None
Referenced Files
F32371880: bashisms
Oct 3 2020, 12:47 AM
Subscribers
None
script ./.bash/func.sh does not appear to have a #! interpreter line;
you may get strange results
possible bashism in ./.bash/func.sh line 7 (should be '.', not 'source'):
[[ ( -f "$*" ) && ( -r "$*" ) ]] && source "$*"
possible bashism in ./.bash/func.sh line 7 (alternative test command ([[ foo ]] should be [ foo ])):
[[ ( -f "$*" ) && ( -r "$*" ) ]] && source "$*"
possible bashism in ./.bash/func.sh line 24 (${!name}):
_list=(${!_var})
possible bashism in ./.bash/func.sh line 27 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $_idx =~ ^-?[0-9]+$ ]]; then
possible bashism in ./.bash/func.sh line 30 (bash arrays, ${name[0|*|@]}):
[[ $_idx -lt 0 ]] && _idx=$((${#_list[@]} + $_idx))
possible bashism in ./.bash/func.sh line 30 (alternative test command ([[ foo ]] should be [ foo ])):
[[ $_idx -lt 0 ]] && _idx=$((${#_list[@]} + $_idx))
possible bashism in ./.bash/func.sh line 32 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -n $_after ]] && _idx=$((_idx + 1))
possible bashism in ./.bash/func.sh line 37 (bash arrays, ${name[0|*|@]}):
for ((i=0; i<=${#_list[@]}; ++i)); do
possible bashism in ./.bash/func.sh line 37 ('((' should be '$(('):
for ((i=0; i<=${#_list[@]}; ++i)); do
possible bashism in ./.bash/func.sh line 38 (bash arrays, ${name[0|*|@]}):
if [[ ${_list[${i}]} =~ $_idx ]]; then
possible bashism in ./.bash/func.sh line 38 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ ${_list[${i}]} =~ $_idx ]]; then
possible bashism in ./.bash/func.sh line 44 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $_found = $_idx ]]; then
possible bashism in ./.bash/func.sh line 46 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -n $_after ]]; then
possible bashism in ./.bash/func.sh line 48 (bash arrays, ${name[0|*|@]}):
_idx=${#_list[@]}
possible bashism in ./.bash/func.sh line 59 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -n $_after ]] && _idx=$((_idx + 1))
possible bashism in ./.bash/func.sh line 65 (alternative test command ([[ foo ]] should be [ foo ])):
[[ $_idx -lt 0 ]] && _idx=0
possible bashism in ./.bash/func.sh line 66 (bash arrays, ${name[0|*|@]}):
_list=(${_list[@]:0:$_idx} $_new ${_list[@]:$_idx})
possible bashism in ./.bash/func.sh line 69 (bash arrays, ${name[0|*|@]}):
export $_var="${_list[*]}"
possible bashism in ./.bash/func.sh line 81 (${parm/?/pat[/str]}):
_escelm=${_elm//\\//\\\\}
possible bashism in ./.bash/func.sh line 83 (${parm/?/pat[/str]}):
_escelm=${_escelm//"$c"/"\\$c"}
possible bashism in ./.bash/func.sh line 86 (${!name}):
[[ ${!_var} =~ $_re ]]
possible bashism in ./.bash/func.sh line 86 (alternative test command ([[ foo ]] should be [ foo ])):
[[ ${!_var} =~ $_re ]]
possible bashism in ./.bash/func.sh line 101 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -d $_dir ]]; then
possible bashism in ./.bash/func.sh line 113 (alternative test command ([[ foo ]] should be [ foo ])):
[[ "Darwin" = "$(uname -s)" ]] && VAR=DYLD_LIBRARY_PATH
possible bashism in ./.bash/func.sh line 123 (${parm/?/pat[/str]}):
OS=$(uname -s); OS=${OS/CYGWIN_*/CYGWIN}
possible bashism in ./.bash/func.sh line 125 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/bin" ]] && list_add_dir PATH "${DIR}/bin"
possible bashism in ./.bash/func.sh line 126 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/bin/${OS}" ]] && list_add_dir PATH "${DIR}/bin/${OS}"
possible bashism in ./.bash/func.sh line 127 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/sbin" ]] && list_add_dir PATH "${DIR}/sbin"
possible bashism in ./.bash/func.sh line 128 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/man" ]] && list_add_dir MANPATH "${DIR}/man"
possible bashism in ./.bash/func.sh line 129 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/share/man" ]] && list_add_dir MANPATH "${DIR}/share/man"
possible bashism in ./.bash/func.sh line 130 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/info" ]] && list_add_dir INFOPATH "${DIR}/info"
possible bashism in ./.bash/func.sh line 131 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -d "${DIR}/share/info" ]] && list_add_dir INFOPATH "${DIR}/share/info"
possible bashism in ./.bash/func.sh line 141 (hash):
if hash realpath &>/dev/null ; then
possible bashism in ./.bash/func.sh line 141 (should be >word 2>&1):
if hash realpath &>/dev/null ; then
possible bashism in ./.bash/func.sh line 145 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -d "$1" ]] ; then
possible bashism in ./.bash/func.sh line 146 (should be >word 2>&1):
cd -P -- "${1}" &>/dev/null && pwd -P
possible bashism in ./.bash/func.sh line 148 (should be >word 2>&1):
cd -P -- "$(dirname -- "$1")" &>/dev/null &&
possible bashism in ./.bash/func.sh line 164 ('function' is useless):
function cdp () {
possible bashism in ./.bash/func.sh line 221 ('function' is useless):
function _cdp () {
possible bashism in ./.bash/func.sh line 225 (bash arrays, ${name[0|*|@]}):
CUR="${COMP_WORDS[COMP_CWORD]}"
possible bashism in ./.bash/func.sh line 226 (compgen):
DIRS=$(cd $TARGET; compgen -o dirnames $2)
possible bashism in ./.bash/func.sh line 227 (alternative test command ([[ foo ]] should be [ foo ])):
OPTS=$(for i in $DIRS; do if [[ $i != ".git" ]]; then echo $i/; fi; done)
possible bashism in ./.bash/func.sh line 228 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ ${CUR} == * ]] ; then
possible bashism in ./.bash/func.sh line 228 (should be 'b = a'):
if [[ ${CUR} == * ]] ; then
possible bashism in ./.bash/func.sh line 229 (compgen):
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
possible bashism in ./.bash/func.sh line 233 (complete):
complete -o nospace -F _cdp cdp
possible bashism in ./.bash/func.sh line 256 (caller):
caller | awk '{printf "%s(%d)\n", $2, $1}'
possible bashism in ./.bash/func.sh line 288 ($HOST(TYPE|NAME)):
local tt="${USER}@${SHORT_HOST:-${HOSTNAME%%.*}} ($(tty|tr / ' '|awk '{print $NF}'))"
possible bashism in ./.bash/func.sh line 290 (echo -e):
echo -ne "\033]0;${tt}\007"
possible bashism in ./.bash/func.sh line 297 ($HOST(TYPE|NAME)):
local st="${USER}@${SHORT_HOST:-${HOSTNAME%%.*}}"
possible bashism in ./.bash/func.sh line 299 (echo -e):
echo -ne "\033k${st}\033\\"
possible bashism in ./.bash/func.sh line 308 (alternative test command ([[ foo ]] should be [ foo ])):
[[ "$*" != *Batchmode* ]] && {