Recovering Corrupted Bash Shell

Matthew Gillen me at mattgillen.net
Sun Feb 25 09:05:09 EST 2007


Matthew Gillen wrote:
> Kristian Hermansen wrote:
>> On 2/24/07, V. Alex Brennen <vab at mit.edu> wrote:
>>> The `reset` command will fix the immediate problem.
>> Ah yes thx.  And how do I find out which characters possess this ability?
> 
> Man I need a life...
> 
> Here's a shell script that you can run to find out.  It uses octal character
> codes, and tries all 256 possibilities.

Apparently attachments get scrubbed...

016 is the first octal code that triggers the corrupt screen for me.  When
you're done, you can use 'man ascii' to figure out what those characters are
supposed to be.

Here's the script:


------

#!/bin/sh
# Script for testing which characters corrupt
# terminal output
#  Matthew Gillen <matt at gillens.us>
#

for i in `seq 0 3`; do
  for j in `seq 0 7`; do
    for k in `seq 0 7`; do
      echo "Attempting octal char: $i$j$k"
      echo -e "\\$i$j$k";
      echo "Corrupt screen? (y/n)";
      read corrupt;
      if [ $corrupt == "y" ]; then
        reset;
      fi;
    done;
  done;
done

-------------

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Discuss mailing list