Issue
In GCP compute Linux I accidentally did cat filebeat
instead of filebeat.yaml
.
After that my .bashrc
contains the below chars and if I type '~'
/>
bash is printing 'ü'.
Need help in fixing this
if Ä -f ü/.bash_aliases Å; then
. ü/.bash_aliases
fi
Solution
This looks like your terminal was accidentally configured for legacy ISO-646-SE or a variant. Your .bashrc
file is probably fine; it's just that your terminal remaps the display characters according to a scheme from the 1980s.
A quick hex dump should verify that the characters in the file are actually correct. Here's an example of what you should see.
bash$ echo '[\]' | xxd
00000000: 5b5c 5d0a [\].
Even if the characters are displayed as ÄÖÅ, they are correct if you see the hex codes 5B, 5C, and 5D. (If you don't have xxd
, try hexdump
or od -t x1
.)
Probably
bash$ tput reset
can set your terminal back to sane settings. Maybe stty sane
might work too (but less likely, in my experience). Else, try logging out and back in.
Back when ASCII was the only game in town, but American (or really any) hardware was exported to places where the character repertoire was insufficient, the local vendor would replace the ROM chips in terminals to remap some slightly less common character codes to be displayed as the missing local glyphs. Over time, this became standardized; the ISO-646 standard was updated to document these local overrides. (The linked Wikipedia page has a number of tables with details. What you see appears to be consistent with Swedish or Finnish or perhaps German settings; slightly different character mappings were used for French, Spanish, Italian, etc.)
Eventually, 8-bit character sets became the norm, and then most locales switched to Latin-1 or some other suitable character set which no longer needed this hack. However, it was still rather prevalent even in the early 1990s. In the early 2000s, Unicode started taking over, and so now this seems like an absurd arrangement.
I'm guessing the file you happened to cat
contained some control characters which instructed your terminal to switch to this legacy character set. It's not entirely uncommon (though usually when it happens to me, it switches to some "graphical" character set where some characters display box-drawing characters or mathematical symbols).
Answered By - tripleee Answer Checked By - Katrina (WPSolving Volunteer)