Imported from ../bash-3.0.tar.gz.
This commit is contained in:
parent
7117c2d221
commit
b80f6443b6
400 changed files with 69247 additions and 13346 deletions
|
|
@ -389,7 +389,7 @@ esac
|
|||
|
||||
trap ':' 2
|
||||
trap exit 3
|
||||
trap "tail -$savehist $histfile>/tmp/hist$$;uniq /tmp/hist$$ > $histfile;\
|
||||
trap "tail -n $savehist $histfile>/tmp/hist$$;uniq /tmp/hist$$ > $histfile;\
|
||||
rm -f /tmp/*$$;exit 0" 15
|
||||
|
||||
getcmd=yes
|
||||
|
|
@ -517,7 +517,7 @@ do
|
|||
esac
|
||||
|
||||
cmd="${cmd};$line"
|
||||
while test "$line" != "done" -a "$line" != "end"
|
||||
while test "$line" != "done" && test "$line" != "end"
|
||||
do
|
||||
echo $n "$PS2$c"
|
||||
read line
|
||||
|
|
@ -531,7 +531,7 @@ do
|
|||
echo "$cmd" > /tmp/bcsh$$
|
||||
;;
|
||||
if[\ \ ]*)
|
||||
while test "$line" != "fi" -a "$line" != "endif"
|
||||
while test "$line" != "fi" && test "$line" != "endif"
|
||||
do
|
||||
echo $n "$PS2$c"
|
||||
read line
|
||||
|
|
@ -659,7 +659,7 @@ esac/
|
|||
-[0-9]*)
|
||||
wanted="`expr \"$i\" : '-\([0-9][0-9]*\).*'`"
|
||||
rest="`expr \"$i\" : '-[0-9][0-9]*\(.*\)'`"
|
||||
i="`tail -$wanted $histfile | sed -e "1q"`"
|
||||
i="`tail -n $wanted $histfile | sed -e "1q"`"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
@ -917,14 +917,14 @@ esac/
|
|||
continue
|
||||
;;
|
||||
exec[\ \ ]*)
|
||||
tail -$savehist $histfile>/tmp/hist$$
|
||||
tail -n $savehist $histfile>/tmp/hist$$
|
||||
uniq /tmp/hist$$ > $histfile
|
||||
rm -f /tmp/*$$
|
||||
echo $cmd > /tmp/cmd$$
|
||||
. /tmp/cmd$$
|
||||
;;
|
||||
login[\ \ ]*|newgrp[\ \ ]*)
|
||||
tail -$savehist $histfile>/tmp/hist$$
|
||||
tail -n $savehist $histfile>/tmp/hist$$
|
||||
uniq /tmp/hist$$ > $histfile
|
||||
rm -f /tmp/*$$
|
||||
echo $cmd > /tmp/cmd$$
|
||||
|
|
@ -936,22 +936,22 @@ esac/
|
|||
# sh $logoutfile
|
||||
$SHELL $logoutfile
|
||||
fi
|
||||
tail -$savehist $histfile > /tmp/hist$$
|
||||
tail -n $savehist $histfile > /tmp/hist$$
|
||||
uniq /tmp/hist$$ > $histfile
|
||||
rm -f /tmp/*$$
|
||||
exit 0
|
||||
;;
|
||||
h|history)
|
||||
grep -n . $histfile | tail -$history | sed -e 's@:@ @' | $PAGER
|
||||
grep -n . $histfile | tail -n $history | sed -e 's@:@ @' | $PAGER
|
||||
continue
|
||||
;;
|
||||
h[\ \ ]\|*|h[\ \ ]\>*|h\|*|h\>*)
|
||||
cmd="`echo \"$cmd\" | sed -e \"s@h@grep -n . $histfile | tail -$history | sed -e 's@:@ @'@\"`"
|
||||
cmd="`echo \"$cmd\" | sed -e \"s@h@grep -n . $histfile | tail -n $history | sed -e 's@:@ @'@\"`"
|
||||
getcmd=no
|
||||
continue
|
||||
;;
|
||||
history[\ \ ]*\|*|history[\ \ ]*\>*)
|
||||
cmd="`echo \"$cmd\" | sed -e \"s@history@grep -n . $histfile | tail -$history | sed -e 's@:@ @'@\"`"
|
||||
cmd="`echo \"$cmd\" | sed -e \"s@history@grep -n . $histfile | tail -n $history | sed -e 's@:@ @'@\"`"
|
||||
getcmd=no
|
||||
continue
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ processdir()
|
|||
set +f
|
||||
for file in * ; do
|
||||
set -f
|
||||
if [ "$file" != "." -a "$file" != ".." ] ; then
|
||||
if [ "$file" != "." ] && [ "$file" != ".." ] ; then
|
||||
if [ -L "$file" ] ; then
|
||||
echo "skipping symlink" $file in `pwd`
|
||||
elif [ -d "$file" ] ; then
|
||||
|
|
|
|||
|
|
@ -125,11 +125,11 @@ function getline
|
|||
unset linesave # forget temp var
|
||||
;;
|
||||
)
|
||||
while [ "${line% }" != "$line" -a ${#line} != 0 ] ; do
|
||||
while [ "${line% }" != "$line" ] && [ ${#line} != 0 ] ; do
|
||||
echo -n " "
|
||||
line="${line%?}"
|
||||
done
|
||||
while [ "${line% }" = "$line" -a ${#line} != 0 ] ; do
|
||||
while [ "${line% }" = "$line" ] && [ ${#line} != 0 ] ; do
|
||||
echo -n " "
|
||||
line="${line%?}"
|
||||
done
|
||||
|
|
@ -151,7 +151,7 @@ function getline
|
|||
# If length is restricted, and the line is too
|
||||
# long, then beep...
|
||||
|
||||
if [ "$2" != 0 -a $(( ${#line} >= $2 )) = 1 ] ; then
|
||||
if [ "$2" != 0 ] && [ $(( ${#line} >= $2 )) = 1 ] ; then
|
||||
echo -n
|
||||
else # Otherwise add
|
||||
line="$line$key" # the character.
|
||||
|
|
@ -182,4 +182,3 @@ getline LINE 50
|
|||
restore
|
||||
|
||||
echo "<$LINE>"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue