mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-03 02:10:50 +02:00
Initial devel branch import from bash-3.0-alpha
This commit is contained in:
@@ -39,7 +39,7 @@ cd()
|
||||
set -- $HOME
|
||||
fi
|
||||
|
||||
if [ "$CDHISTFILE" -a -r "$CDHISTFILE" ] # if directory history exists
|
||||
if [ "$CDHISTFILE" ] && [ -r "$CDHISTFILE" ] # if directory history exists
|
||||
then
|
||||
typeset CDHIST
|
||||
i=-1
|
||||
@@ -49,7 +49,7 @@ cd()
|
||||
done <$CDHISTFILE
|
||||
fi
|
||||
|
||||
if [ "${CDHIST[0]}" != "$PWD" -a "$PWD" != "" ]
|
||||
if [ "${CDHIST[0]}" != "$PWD" ] && [ -n "$PWD" ]
|
||||
then
|
||||
_cdins # insert $PWD into cd history
|
||||
fi
|
||||
|
||||
@@ -56,13 +56,13 @@ FindSectionsInIndex ()
|
||||
fi
|
||||
done
|
||||
[ -z "$indexes" ] && return
|
||||
# Make egrep give filename
|
||||
# Make grep give filename
|
||||
[ NIndex -lt 2 ] && indexes="$indexes /dev/null"
|
||||
# set positional parameters to
|
||||
# indexfile:searchname pagename section ...
|
||||
# e.g.
|
||||
# /usr/man/index:FP_OFF Routines DOS
|
||||
set -- `egrep "^$page[ ]" $indexes`
|
||||
set -- `grep "^$page[ ]" $indexes`
|
||||
while [ $# -gt 2 ]; do
|
||||
FileNames[i]=${1%%index*}cat$3/$2.$3
|
||||
Sections[i]=$3
|
||||
|
||||
@@ -110,7 +110,7 @@ function CopyFiles {
|
||||
*/) ;; # don't add / if trailing / already present
|
||||
*) if [ $# -gt 2 ] || # if more than two args given, last must be a dir
|
||||
# If dest in on local machine, check whether it is a directory
|
||||
[ $DestMach = $LocalMach -a -d $DestPath ] ||
|
||||
[ $DestMach = $LocalMach ] && [ -d "$DestPath" ] ||
|
||||
# If dest ends with . or .., it is a directory
|
||||
lastisdot "$DestPath"
|
||||
then
|
||||
|
||||
@@ -103,7 +103,7 @@ esac
|
||||
|
||||
shift
|
||||
|
||||
[ -z "$end" -o $count -le "$end" ] && increment=1 || increment=-1
|
||||
[ -z "$end" ] && [ $count -le "$end" ] && increment=1 || increment=-1
|
||||
|
||||
istrue $verbose && echo "start=$count end=$end" 1>&2
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ for i in "$@"; do
|
||||
vars="$vars $i"
|
||||
;;
|
||||
*)
|
||||
if [ ! -x $i -o ! -d $i ]; then # arg must be a dir and executable
|
||||
if [ ! -x $i ] || [ ! -d $i ]; then # arg must be a dir and executable
|
||||
echo "$i: directory not accessible."
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user