Sponsored Content
Top Forums Shell Programming and Scripting Escape characters in a variable Post 303033155 by bakunin on Sunday 31st of March 2019 10:46:30 AM
Old 03-31-2019
Quote:
Originally Posted by wisecracker
Code:
AMIGA:\u\w> ESC=$( printf "\033" )

This works but one can enter the ESC character (and most other characters) directly, at least in vi *) so you won't need a subshell: in insert mode press <CTRL>-<V> to enter the next character verbatim. If you press i.e. <CTRL>-<V> and then <ESC> the editor window will show usually this:

Code:
^[
~
~
~

This is vis way of "printing" an unprintable character. Moving over with the cursor will confirm that it is NOT a caret character followed by a opening square bracket but a single character - the ESC. You can use it exactly as this. I usually put a comment on such lines to make sure i remember that:

Code:
typeset chMyESC="^["           # WARNING: literal ESC char!

Likewise you can i.e. enter literal <ENTER> characters the same way which will look like ^M and may more.

I hope this helps.

bakunin
__________
*) i have heard rumors about other editors being out there too. They haven't been confirmed yet.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

lp FormFeed Escape characters

I'm trying to modify the /usr/lib/lp/model/netstandard file to generate a header for all the print jobs that are sent, but there is no formfeed defined so the the job prints right after the header with no page break. What is the sequence I need in order to generate a formfeed? Or, do you have... (4 Replies)
Discussion started by: jgordon
4 Replies

2. Shell Programming and Scripting

number of escape characters?

Hi, I am trying to execute the following command from a batch script, but no matter how many escape characters I put in it doesn't execute properly. It works fine from the command line with quotes around the -exec part. #!/bin/sh /usr/local/bin/sudo /usr/atria/bin/cleartool setview -exec... (0 Replies)
Discussion started by: Sebarry
0 Replies

3. Shell Programming and Scripting

escape characters..

hey i want to know the unix commands to replace all the character escape sequences with their "C" values in a string... thanks in advance..! Regards, Sharanya (9 Replies)
Discussion started by: sharsin2001
9 Replies

4. Shell Programming and Scripting

Searching for escape characters

Hi all I have been trying to write a script to look for a set of specific escape characters in a file. On viewing the file via vi it shows this : ^ I understand this means no end of line. I have tried a vary of grep parameters such as grep ^\^. filename grep --binary-file=binary without... (8 Replies)
Discussion started by: timcs
8 Replies

5. UNIX for Dummies Questions & Answers

Escape Characters on various shells

Hi, I want to know if escape charaters work on all the popular UNIX shells. More specifically I want to know if echo "\c" will work on most of the UNIX shells and are there any specific shells on which \c won't work. Please help. Thanks, Vineet (2 Replies)
Discussion started by: vineetd
2 Replies

6. Shell Programming and Scripting

Removing Escape Sequence Characters

Hi All, I have added the script command to user profile so that to record the on-screen data.But when i i checked the O/P i could see lot of escape sequence is there way to remove it. (2 Replies)
Discussion started by: cutechaps
2 Replies

7. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

8. Shell Programming and Scripting

Escape special characters in SED

Need help in escaping special characters in sed command. Here is the the string which i am trying to find a replace with From :- REQUEST_TYPE=PIXEL&amp;MSG_ID={//MESSAGE_ID} To :- REQUEST_TYPE=PIXEL&amp;MSG_ID= X_EDELIVERY_MESSAGE_ID &amp; BATCH_ID= X_EDELIVERY_BATCH_ID Here is the sed command i am... (2 Replies)
Discussion started by: aakishore
2 Replies

9. Shell Programming and Scripting

Escape characters

i am executing script from A server which will execute the script in B server , as below. ssh A 'ssh B echo 'select * from testing where name ='test'' i am getting the below output. select * from testing where name=test but i need the output where clause with quotes , tried with... (3 Replies)
Discussion started by: expert
3 Replies

10. Shell Programming and Scripting

How to escape all special characters?

I have an application which I am integrating with that accepts the password via a CLI. I am running in to issues with passwords that contain special characters. I tried to escape them all, but I ran in to an issue where I cannot escape the characters ' ] My attempt is as follows: $... (2 Replies)
Discussion started by: AMG1978
2 Replies
iso2022jp(5)							File Formats Manual						      iso2022jp(5)

NAME
iso2022jp, iso-2022-jp, ISO-2022-JP - A character encoding system (codeset) for Japanese DESCRIPTION
The ISO-2022-JP codeset consists of the following character sets: ASCII For information on the ASCII character set, refer to ascii(5). JIS X0201-1976 Only the Roman letters in this character set are included. For details, refer to deckanji(5). JIS X0208-1978 JIS X0208-1983 JIS X0208-1983 is a revised version of JIS X0208-1978 and remapped some characters of JIS X0208-1978 to other positions. Before a character is used, its corresponding character set must be designated. In ISO-2022-JP, the designation of a character set is done by using an escape sequence as follows: --------------------------------------------------------------- Escape Sequence Character Set --------------------------------------------------------------- ESC ( B ACSII ESC ( J JIS X0201-1976 (left-hand part) ESC $ @ JIS X0208-1978 ESC $ ( 0 User-defined characters (This range of char- acters is proprietary to Compaq.) ESC $ B JIS X0208-1983 --------------------------------------------------------------- It is assumed that the starting code of a line is ASCII (including CR alone and LF alone, but not including the combination CRLF). If there are JIS X0208 characters on a line, there must be a switch to ASCII or to the left-hand part of JIS X0201 (Roman letters) before the end of the line (in other words, before the CRLF, or carriage return and line feed). For example, if a line starts with the ASCII character 9, followed by the JIS X0208-1978 character at row 16 column 1, the line is encoded as follows: 39h ESC $ @ 30h 21h .... ESC ( B .... CRLF If a line starts with the JIS X0208-1978 character at row 16 column 1, followed by the ASCII character 9, then the line is encoded as fol- lows: ESC $ @ 30h 21h ESC ( B 39h .... CRLF Once a character set is designated, there is no need to redesignate the character set if the adjacent character belongs to the same charac- ter set. For example, the following practice is not recommended: ESC $ B .... ESC $ B .... Currently, the operating system supports the ISO 2022-JP codeset only through codeset converters; there is no direct support through locales or fonts. For your options in printing and displaying Japanese characters, refer to i18n_printing(5) and Japanese(5). Codeset Conversion The following codeset converter pairs are available for converting Japanese characters between ISO-2022-JP and other encoding formats. In converter names, the string ISO-2022-JP indicates that user-defined characters are not included in the conversion jwhile the string ISO-2022-JPext indicates that user-defined characters are included in the convertsion. Refer to iconv_intro(5) for an introduction to code- set conversion. For more information about the other codeset for which ISO-2022-JP or ISO-2022-JPext is the input or output, see the refer- ence page specified in the list item. deckanji_ISO-2022-JP or deckanji_ISO-2022-JPext, ISO-2022-JP_deckanji or ISO-2022-JPext_deckanji Converting from and to the DEC Kanji codeset: deckanji(5). eucJP_ISO-2022-JP or eucJP_ISO-2022-JPext, ISO-2022-JP_eucJP or ISO-2022-JPext_eucJP Converting from and to Japanese Extended UNIX Code: eucJP(5). sdeckanji_ISO-2022-JP or sdeckanji_ISO-2022-JPext, ISO-2022-JP_sdeck- anji or ISO-2022-JPext_sdeckanji Converting from and to the Super DEC Kanji codeset: sdeckanji(5). SJIS_ISO-2022-JP or SJIS_ISO-2022-JPext, ISO-2022-JP_SJIS or ISO-2022-JPext_SJIS Converting from and to the Shift JIS codeset: SJIS(5). Note that SJIS encoding is equivalent to the Microsoft code-page format used on PC systems. Therefore, you can use these converters to convert Japanese characters between the ISO 2022-JP and PC code-page formats. See code_page(5) for information on how the operat- ing system supports PC code pages. SEE ALSO
Commands: locale(1) Others: ascii(5), code_page(5), deckanji(5), eucJP(5), i18n_intro(5), i18n_printing(5), iconv_intro(5), iso2022(5), Japanese(5), jiskanji(5), l10n_intro(5), sdeckanji(5), shiftjis(5) iso2022jp(5)
All times are GMT -4. The time now is 03:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy