Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recovering Corrupted Bash Shell



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.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org