Package: bash-doc
Version: 3.1dfsg-8
Severity: minor
Tags: patch

Hello,

I've had some issues with the example file in :
/usr/share/doc/bash-doc/examples/startup-files/Bash_aliases

First, it redefines the seq function without using
the /usr/bin/seq program, which cause some issues in bash.

So it would be better to rename this internal function
to _seq.

After that, this function has a bug (one iteration too far)
First :
repeat 10 echo "foo" | wc -l ==> 11
After my patch :
repeat 10 echo "foo" | wc -l ==> 10

Thank you very much for applying this patch :)



--- Bash_aliases        2007-05-12 11:14:54.000000000 +0200
+++ Bash_aliases.new    2007-05-12 11:15:34.000000000 +0200
@@ -41,20 +41,20 @@
 {
     local count="$1" i;
     shift;
-    for i in $(seq 1 "$count");
+    for i in $(_seq 1 "$count");
     do
         eval "$@";
     done
 }

 # Subfunction needed by `repeat'.
-seq ()
+_seq ()
 {
     local lower upper output;
     lower=$1 upper=$2;

     if [ $lower -ge $upper ]; then return; fi
-    while [ $lower -le $upper ];
+    while [ $lower -lt $upper ];
     do
        echo -n "$lower "
         lower=$(($lower + 1))



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.20-1-k7 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to