Not able to input \ backslash when vi editor


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Not able to input \ backslash when vi editor
# 1  
Old 12-03-2018
Not able to input \ backslash when vi editor

Hi,
How do I input \ when I do a vi of my file ? I try to input the \ but it came out as @.
Appreciate any help.
# 2  
Old 12-03-2018
That really depends on your terminal settings and having your keyboard set up normally or correctly:

On MacOX

Code:
$ vi test.text

(type \\\\\\\ in terminal)

Code:
$ cat test.text

\\\\\\ 

$

Works fine for me on MacOS... now try Linux:

Code:
$ vi text.text

(type \\\\\\\ in terminal)

Code:
$ cat text.text
\\\\\\\
$

Sounds like your keyboard may not be mapped properly, that is the first thing that come to mind.
# 3  
Old 12-03-2018
Hi, I have installed the Solaris 11 on a Oracle VM box. How do I do the mapping of the backslash ?
# 4  
Old 12-03-2018
Maybe this will help you:

REF:

6.15 Non-US Keyboard Mappings Not Reliable in Virtual Machine Console


Quote:
6.15 Non-US Keyboard Mappings Not Reliable in Virtual Machine Console

Non-US keyboard mappings do not behave predictably in the virtual machine console available in the Oracle VM Manager Web Interface. To ensure the best possible behavior within the Virtual Machine console, it is advisable to set all keyboard mapping options en-us on your virtual machines and to use a US keyboard when working with the virtual machine console. This is not a requirement, but currently not all keyboard mappings behave as expected within the virtual machine console.

Bug 18089107
# 5  
Old 12-03-2018
Also, consider these examples for Solaris 11 timezone and keyboard settings:


Install nlsadm for easier management of national language properties (Solaris 11.2)
Code:
# pkg install nls-administration

Get current configuration
Code:
# nlsadm get-console-keymap
# nlsadm get-system-locale
# nlsadm get-timezone

List available timezones
Code:
# nlsadm list-timezone

List available console keymaps
Code:
# nlsadm list-console-keymap

List available locales
Code:
# nlsadm list-locale

Set timezone to Europe/Berlin
Code:
# nlsadm set-timezone Europe/Berlin

Set locale to de_DE.UTF-8
Code:
# nlsadm set-system-locale de_DE.UTF-8

Set console keymap to UK-English
Code:
# nlsadm set-console-keymap UK-English

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

grep for a backslash question

Why does this work when grepping for a backslash? grep '\\' .bash_history grep "" .bash_historyWhy does this not work when grepping for a backslash? grep "\\" .bash_historyI know this works works but just don't understand why I need 4 backslashes when using double quotes. grep "\\\\"... (7 Replies)
Discussion started by: cokedude
7 Replies

2. Shell Programming and Scripting

Echo backslash

If I echo "\\" I get a backslash returned ~$ echo "\\" \ Why doesn't this work: string=`echo "\\"` echo $string I get the error message: bash: command substitution: line 1: unexpected EOF while looking for matching `"' bash: command substitution: line 2: syntax error: unexpected end... (2 Replies)
Discussion started by: locoroco
2 Replies

3. UNIX for Dummies Questions & Answers

eval removes backslash

Hi, ============= In one of my config files, I have below command eval echo RECORDDELIMITER '\n' The above command results in removing backslash and outputs: RECORDDELIMITER n ============= Any workaround to retain the backslash after eval. Appreciated for your... (10 Replies)
Discussion started by: axes
10 Replies

4. UNIX for Dummies Questions & Answers

./configure backslash questions

Hello all. I am going to try my hand at compiling tarballs rather than installing packages. I have a pretty good understanding of the process and have even compiled/installed Top from source. But that was an easy install, I want to try something more complex using the various configure... (6 Replies)
Discussion started by: RobertSubnet
6 Replies

5. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

6. UNIX for Dummies Questions & Answers

Escaping backslash

I have a variable containt something like this, c:\mask\mask. How can I escape "\" in the values? I want the value as it it. (9 Replies)
Discussion started by: swmk
9 Replies

7. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

8. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

9. UNIX for Dummies Questions & Answers

backslash issues

Hi, I have a script which looks through an input file and takes data from the file to use within the script. Everything works fine until the script reads the item \windows\directory\structure\ from the input file into a variable. As unix sees the backslash as an escape character, the... (5 Replies)
Discussion started by: Bab00shka
5 Replies

10. Shell Programming and Scripting

Adding a backslash to users' input

Hi, I need to convert user-input from '(this)' to '\(this\)' before passing it to egrep. I've tried using TR, SED and NAWK to add the backslash, but the most I ever get is a backslash without a '(' or ')'. Any ideas? Thanks! (13 Replies)
Discussion started by: netguy
13 Replies
Login or Register to Ask a Question