Help!

2006-05-01 Thread Miguel Luis
Hello, I started with linux for a year, so I think I still a beginner.. 
(Sorry if what I am about to report is nothing that should be sent to 
this email)


- I'm Using Ubuntu Dapper Drake.

- My bash version:

[EMAIL PROTECTED]:~/Desktop$ bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
[EMAIL PROTECTED]:~/Desktop$



- I just ran my cesar's program like this:

[EMAIL PROTECTED]:~/Desktop$ echo "Hello World\n" | ./cesar 4

- and then my bash was:

[EMAIL PROTECTED]:·/D␊⎽┐├⎺⎻$

---

"cesar" code:

#include 
#include 

int
main ( int argc, char ** argv )
{
int x, c;

if (argc != 2) exit ( 1 );

if (sscanf ( argv[1], "%d", &x ) != 1) exit ( 1 );
if (x < 0) x = -((-x) % 256);

while ((c = getchar ()) != EOF) {
putchar ( (c + x + 256) % 256 );
}

return 0;
}


---


Best regards,

Miguel Luis.
Portugal - Azores


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Help!

2006-05-01 Thread Bob Proulx
Miguel Luis wrote:
> - I'm Using Ubuntu Dapper Drake.

I don't believe that Ubuntu has released Dapper Drake yet.  Therefore
what you have must be a release candidate for Dapper Drake.

> [EMAIL PROTECTED]:~/Desktop$
> - I just ran my cesar's program like this:
> [EMAIL PROTECTED]:~/Desktop$ echo "Hello World\n" | ./cesar 4
> - and then my bash was:
> [EMAIL PROTECTED]:·/D␊⎽┐├⎺⎻$

What you are seeing is almost certainly terminal issues due to the
sending of binary data to it from the output of your program.
Terminals often do not react well to having random binary data thrown
at them.  This is not a bash issue but one of understanding your
terminal.

Terminals interpret escape sequences and act upon them to select
alternate character sets and things like that.  It looks to me like
you have turned on an alternate character set.  Try resetting the
terminal to restore it to normal use.  In xterm this can be done on
the fly with control-middlebutton "Do Full Reset".  Other terminals
probably have something similar.  Or you might try typing in blind
"reset" and if available it should also reset the terminal.

Bob


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Bash-3.1.17 gets lost looking for end of string in certain contexts

2006-05-01 Thread Richard
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/mnt/STG1/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I/mnt/STG1/opt/sources/bash-3.1 
-I/mnt/STG1/opt/sources/bash-3.1/include -I/mnt/STG1/opt/sources/bash-3.1/lib   
-O2 -pipe
uname output: Linux lfs1 2.4.26-0 #1 Sun Aug 29 09:59:18 BRT 2004 i686 
GenuineIntel unknown GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

Description:
Bug uncovered as follows:

Compiling grep-2.5.1a and during its tests, test #121 is not completed 
because of following error messages by bash:

spencer1.script: line 602: unexpected EOF while looking for matching `''
spencer1.script: line 608: syntax error: unexpected end of file

The offending lines (602 thru 607) from spencer1.script are:

602 status=`echo 'beriberi'| { ${GREP} -E -e '().*\1' >/dev/null 2>&1 ; 
echo $?; }`
603 if test $status -ne 0 ; then
604 echo Spencer test \#121 failed
605 failures=1
606 fi
607 exit $failures

FYI: Running same script thru bash-2.05b all tests in script complete 
successfully.

Repeat-By:
Run testsuite of grep-2.5.1a with bash-3.1.17, or use above snippet as 
reference.


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash