I Can´t type | in the terminal


#1

I can´t type the | symbol in the terminal even I have tried with "alt gr +124" and "alt + 124".


#2

did you see this topic? it has a number of suggestions, one of them should work


#3

Yes, I have seen it. I tried the "alt gr combinations" and the screenplay keyboard, but none of them worked. Is there any way to continue the course without doing this exercise? Thank you!


#4

did you try option 1 and 4 as well? 5 can always be used, if it is really not working

you used alt gr? you should have used alt (alt gr won't work)


#5

I've got a work-around that generates it on the remote machine, it takes a few steps that need to be carried out exactly:

Enter this:

EDITOR=vim

Then hold down Ctrl while pressing X and then E

press i
press Ctrl K
press !
press !
press ESC key
press :
press w
press q
press Enter key

You'll now be back at the shell with an error message saying | isn't a valid command

press up-arrow

Pressing up goes up in history, what all the previous did was to create | as a line in history, and now you can go back to it.


#6

Another alternative is:

printf '\174\n' >> /home/ccuser/.bash_history
history -n

And then pressing up key

(but hey, the previous version uses my main text editor so I gotta be partial to that :P)

174 is the ascii value for | written in octal (base 8)
I obtained it like this:

python -c 'print("{:o}".format(ord("|")))'

Where the vertical bar can be switched out for any other character, but obviously you would need another machine to run that on, for example if you have python istalled then you can run just the print part of that


#7

Also, note that in the title of this thread, you used ` instead of '
Those are two different characters, both are used differently in programming languages and you gotta tell those apart


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.