in reply to OT: a bash shell oddity, need explanation

Thanks choroba, but in trying to replicate the problem, I think some unwanted control characters got put into my shell.

I was looking at Removing non-printing (hex codes) from text files and ran at the following code as an experiment:

#!/usr/bin/perl $s .= chr for 1..255; print $s,"\n\n"; $s =~ tr/\x20-\x7f//cd; print $s,"\n\n";
Only after running that code in a terminal, will the ?1 execution work as I describe. If that code is not run first, the ?1 acts normally, saying "file not found".

So that opens a new question, how do those hidden control codes get saved for the next execution in that terminal?


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: OT: a bash shell oddity, need explanation
by roboticus (Chancellor) on Feb 07, 2014 at 17:04 UTC

    zentara:

    A vt100 has an "answerback" string--you send an escape sequence to tell the terminal what to send you when you send the appropriate "inquiry" character. I don't know what terminal you're using, but it's possibly a similar mechanism.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^2: OT: a bash shell oddity, need explanation
by no_slogan (Deacon) on Feb 07, 2014 at 14:09 UTC
    IDK. Try it from within a bash -x and see what happens?