Re: Why does my program change the characters in my shell

From: Andrew Gabriel (andrew_at_cucumber.demon.co.uk)
Date: 06/26/03


Date: 26 Jun 2003 08:28:23 GMT

In article <3EFA632F.2FC168CD@icehouse.net>,
        Andrew Falanga <excalibur@icehouse.net> writes:
> Hello,
>
> I'd like to know what the typical reason for this is. I'm debugging a
> program I've written, and to make sure I'm using sscanf( ) and strcpy(
> ). However, when it gets done puting the data on stdout, the program is
> supposed to prompt me for action.
>
> What is displayed is really weird text. No English alphabetic
> characters, just right angled shapes and stuff. What normally alters
> the character set of stdout (don't know if I worded that correctly)?

Run the program with the output sent to a file, and then read
the file with vi or cat -v (or pipe output through cat -v) and
you will likely see you are generating non-printing charaters.
You are probably hitting upon the sequence to put the terminal
into block graphics mode.

-- 
Andrew Gabriel
Consultant Software Engineer


Relevant Pages

  • Re: [SLE] Redirection puzzle
    ... you can't easily have STDOUT go to the screen while both STDERR ... The putative "chatty" program can be created as a trivial script: ... % cat file ...
    (SuSE)
  • Reusing stdout without a temporary file [was Re: Printing and counting output]
    ... >> to stderr, not stdout. ... Solaris under zsh the first exec hung the shell; ... In this case the second (cat>&3) is pretty innocuous but this cat could ...
    (comp.unix.shell)
  • Re: Re:Re: Cat a directory
    ... FreeBSD has a better view of the world than some of the kiddie OSes. ... > And you mean that cat is built to show directories and that's the right job ... Just to copy file's contents to stdout, period, done, end, get a life! ... > doesn't ls support coloring of different file types like in Linux. ...
    (freebsd-questions)
  • Why does my program change the characters in my shell
    ... and to make sure I'm using sscanf() and strcpy( ... However, when it gets done puting the data on stdout, the program is ... the character set of stdout? ...
    (comp.unix.programmer)
  • Re: open CONSOLE?
    ... >and have $get the both STDOUT and STDERR. ... cat: bar: No such file or directory ...
    (perl.beginners)