LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pipe ù NOT | why? (https://www.linuxquestions.org/questions/linux-newbie-8/pipe-%F9-not-%7C-why-4175519653/)

Wyght 09-21-2014 09:57 PM

Pipe ù NOT | why?
 
Hi

I am trying to learn how to use the Terminal, I am learning how to cat .txt files. I read that if the .txt file is large enough that it scrolls off the page you can pipe the output.

Code:

    cat doc.txt | more
which will only print one screen full and you hit enter to get the next screen of text until finished. My problem is when I use the "|" or pipe key while in
Mint 17 terminal this character ù is printed to screen, which of course will not work. If I use gedit 2.30.4 to type in cat doc.txt | more copy that
and paste in Terminal this is what is pasted cat doc.txt ù more

Can anyone tell me what I am doing wrong or where to go to read what I am doing wrong.

Thanks

btmiller 09-21-2014 10:19 PM

Sounds like you have an incorrect keymap set up somewhere, but it's odd that it just happens in the terminal and not in gedit. Which terminal emulator are you using? Does it have a settings menu where you can select keyboard mapping?

BTW, in your case (just viewing a single file), you can simply type:

Code:

more doc.txt
or even better

Code:

less doc.txt

sgosnell 09-21-2014 10:46 PM

Sounds like you might have either an incorrect keyboard layout or non-standard keymapping. I don't know what the UK keyboard layout gives for |, possibly | or perhaps something else. I know there are several keys that are different from the US layout, as are many other layouts. And it's also possible to map any key to practically any character.

Wyght 09-21-2014 10:53 PM

Quote:

BTW, in your case (just viewing a single file), you can simply type:

Code:

more doc.txt
or even better

Code:

less doc.txt

Thanks for this idea, I tried it and it works great. As for the type of Terminal, I don't know how to find out as there is no menu, no name nothing really other than a frame and text area. It is the one that Mint 17 automatically installs. It is weird that the | only messes up in that Terminal it works here fine and in gedit.

Thanks again

Wyght 09-21-2014 10:58 PM

Quote:

Originally Posted by sgosnell (Post 5242126)
Sounds like you might have either an incorrect keyboard layout or non-standard keymapping. ... I know there are several keys that are different from the US layout, as are many other layouts. And it's also possible to map any key to practically any character.

My keyboard layout is English US using same layout for all windows, the pipe '|' key works on everywhere else even on gedit.

Where do I learn to map a key to a specific key?

Thanks

pan64 09-22-2014 12:58 AM

there are several ways, but first would be nice to know the real name of that terminal emulator.

Wyght 09-22-2014 01:07 AM

Quote:

Originally Posted by pan64 (Post 5242158)
there are several ways, but first would be nice to know the real name of that terminal emulator.

GNOME Terminal 3.6.2

turns out there is a menuBar, its turned off by default and I did not check. OS is Mint 17 Cinnamon 64 bit

pan64 09-22-2014 02:31 AM

in gnome terminal there is a menu Terminal->Set character encoding-> choose what you want or you can add additional sets

sgosnell 09-22-2014 02:18 PM

I don't run gnome, and I can't recall the keyboard mapping methods there. Google should find it, if your Google Foo is good enough.

suicidaleggroll 09-22-2014 03:56 PM

I use GNOME Terminal on my system with the character encoding set to "Unicode (UTF-8)", and everything works well.

Smokey_justme 09-22-2014 05:39 PM

Since "|" is well in the first 127 ASCII characters, most likely the terminal is set to use stuff like UTF-16 or some weird encoding.. Switch anything you find in the terminal emulator settings about character encoding to UTF-8 (as someone already said above) and everything should work again... Weird that this happend by default...

Fred Caro 09-22-2014 08:35 PM

On uk quatry keyboard pipe is above the \ symbol; on a us keyboard layout(software
) it is often elsewhere, especialy if the pc is meant for the uk. You could try pluging in a USB keyboard and see if that gives you different results. The pipe key results seems to differ more than most.

Fred.

Beryllos 09-23-2014 02:08 AM

1 Attachment(s)
Could it be due to the font?

I have gnome terminal 3.4.1.1 in which I can select the display font (in the menu, Edit -> Profile Preferences, then select the General tab). Currently a check box is checked to "Use the system fixed width font." If I uncheck that, I can select another font. If I wished to change it, I would choose a monospace font. Courier is a monospace font. Other monospace fonts usually have "Mono" in the name.

Since you know it displays correctly in gedit, you should also inspect which font is used in gedit (in the gedit 3.4.2 menu, Edit -> Preferences, then select the Font & Colors tab). In my gedit preferences, the checkbox for "Use the system fixed width font (Monospace 11)" is checked. If I uncheck it, I can choose another font.

By the way, the title of your thread reminds me of this painting:
Attachment 16492
The Treachery of Images, by René Magritte
in which it is written "This is not a pipe."

(click on image to magnify it)

Source: http://en.wikipedia.org/wiki/The_Treachery_of_Images


All times are GMT -5. The time now is 06:01 PM.