Browse Source

Исправлены ошибки использования if [ ... ]

master
Maxim Likhachev 20 years ago
parent
commit
6205cedebf
  1. 2
      etc/shell/bash/aliases
  2. 28
      etc/shell/bash/bash_completion
  3. 10
      etc/shell/bash/bashrc

2
etc/shell/bash/aliases

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/bash ####################################################################
#
# Изменён: Сб 07 сен 2013 14:03:57
# Изменён: Вск 01 Янв 2006 20:31:28
#
################################################################################
#{{{ Псевдонимы

28
etc/shell/bash/bash_completion

@ -194,7 +194,7 @@ _filedir() @@ -194,7 +194,7 @@ _filedir()
#glob=$(set +o|grep noglob) # save glob setting.
#set -f # disable pathname expansion (globbing)
if [ "${1:-}" = -d ]; then
if [[ "${1:-}" = -d ]]; then
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -d -- $cur ) )
#eval "$glob" # restore glob setting.
return 0
@ -256,9 +256,9 @@ _available_interfaces() @@ -256,9 +256,9 @@ _available_interfaces()
{
local cmd
if [ "${1:-}" = -w ]; then
if [[ "${1:-}" = -w ]]; then
cmd="iwconfig"
elif [ "${1:-}" = -a ]; then
elif [[ "${1:-}" = -a ]]; then
cmd="ifconfig"
else
cmd="ifconfig -a"
@ -272,7 +272,7 @@ _available_interfaces() @@ -272,7 +272,7 @@ _available_interfaces()
#
_expand()
{
[ "$cur" != "${cur%\\}" ] && cur="$cur\\"
[[ "$cur" != "${cur%\\}" ]] && cur="$cur\\"
# expand ~username type directory specifications
if [[ "$cur" == \~*/* ]]; then
@ -455,7 +455,7 @@ _function() @@ -455,7 +455,7 @@ _function()
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ $1 == @(declare|typeset) ]]; then
if [ "$prev" = -f ]; then
if [[ "$prev" = -f ]]; then
COMPREPLY=( $( compgen -A function -- $cur ) )
elif [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-a -f -F -i -r -x -p' -- \
@ -527,7 +527,7 @@ complete -F _complete complete @@ -527,7 +527,7 @@ complete -F _complete complete
# start of section containing completion functions for external programs
# a little help for FreeBSD ports users
[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list \
[[ $UNAME = FreeBSD ]] && complete -W 'index search fetch fetch-list \
extract patch configure build install reinstall \
deinstall clean clean-depends kernel buildworld' make
@ -717,8 +717,8 @@ _insmod() @@ -717,8 +717,8 @@ _insmod()
prev=${COMP_WORDS[COMP_CWORD-1]}
# behave like lsmod for modprobe -r
if [ $1 = "modprobe" ] &&
[ "${COMP_WORDS[1]}" = "-r" ]; then
if [[ $1 = "modprobe" ]] &&
[[ "${COMP_WORDS[1]}" = "-r" ]]; then
COMPREPLY=( $( /sbin/lsmod | \
awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' ) )
return 0
@ -748,8 +748,8 @@ complete -F _insmod $filenames insmod modprobe modinfo @@ -748,8 +748,8 @@ complete -F _insmod $filenames insmod modprobe modinfo
# man(1) completion
#
[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] &&
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] &&
_man()
{
local cur prev sect manpath UNAME
@ -993,8 +993,8 @@ _find() @@ -993,8 +993,8 @@ _find()
-noleaf -version -xdev '
COMPREPLY=( $( echo "${COMP_WORDS[@]}" | \
(while read -d ' ' i; do
[ "$i" == "" ] ||
[ "${onlyonce/ ${i%% *} / }" == "$onlyonce" ] &&
[[ "$i" == "" ]] ||
[[ "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] &&
continue
# flatten array with spaces on either side,
# otherwise we cannot grep on word boundaries of
@ -2338,7 +2338,7 @@ _chsh() @@ -2338,7 +2338,7 @@ _chsh()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ "$prev" = "-s" ]; then
if [[ "$prev" = "-s" ]]; then
if [ -f /etc/debian_version ]; then
COMPREPLY=( $( </etc/shells ) )
else
@ -9283,7 +9283,7 @@ if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \ @@ -9283,7 +9283,7 @@ if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
-x $BASH_COMPLETION_DIR ]; then
for i in $BASH_COMPLETION_DIR/*; do
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|.rpm*) ]] &&
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
[ \( -f $i -o -h $i \) -a -r $i ] && . $i 2>&-
done
fi
unset i

10
etc/shell/bash/bashrc

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/bash ####################################################################
#
# Изменён: Вс 08 сен 2013 22:24:12
# Изменён: Вск 01 Янв 2006 20:31:43
#
################################################################################
@ -61,8 +61,6 @@ if [[ $OS != Windows* ]]; then @@ -61,8 +61,6 @@ if [[ $OS != Windows* ]]; then
export C_INCLUDE_PATH=/usr/libexec/gcc/i486-slackware-linux/$GCCV/:/usr/lib/gcc/i486-slackware-linux/$GCCV/include-fixed/:/usr/lib/gcc/i486-slackware-linux/$GCCV/include
export CPLUS_INCLUDE_PATH=/usr/lib/gcc/i486-slackware-linux/$GCCV/include-fixed/
export LD_LIBRARY_PATH=/usr/libexec/gcc/i486-slackware-linux/$GCCV/
OOoPath="$HOME/Programs/Soft/OOo/openoffice.org3/program/"
fi
#Формат времени, выводимый командой time
@ -139,7 +137,7 @@ path-- () { @@ -139,7 +137,7 @@ path-- () {
local i
for i in ${!2}; do
if [ "$i" != "$1" ]; then
if [[ "$i" != "$1" ]]; then
newpath=${newpath:+$newpath:}$i
fi
done
@ -153,7 +151,7 @@ path++ () { @@ -153,7 +151,7 @@ path++ () {
local i
for i in $1; do
if [ -d "$i" ]; then
if [[ -d "$i" ]]; then
if [ -z "${!2:-}" ]; then
export $2=""
fi
@ -192,8 +190,6 @@ if [ $UID -eq 0 ]; then @@ -192,8 +190,6 @@ if [ $UID -eq 0 ]; then
path++ /usr/sbin PATH
path++ /usr/local/sbin PATH
else
path++ $OOoPath PATH
PROMPT_COLOR='\033[1;32m'
export HOME=/home/$(whoami)
fi

Loading…
Cancel
Save