Sponsored Content
Top Forums Shell Programming and Scripting Escape Characters are driving me crazy! Post 302345945 by troym72 on Thursday 20th of August 2009 04:13:21 PM
Old 08-20-2009
Escape Characters are driving me crazy!

Hi everyone,

Is there anywhere I can find a complete table of all characters that must be escaped by the various UNIX shells and scripting languages?

It seems every command/shell/scripting language has different rules about what characters must be escaped.

I do a lot of searching and replacing with files that contain all kinds of characters like ^{}[]()!@#$%&*_+=|\<>.,?~`:";' Did I cover them all?

Can anyone point me to a reference list/table of some kind that I can use. I would love to be able to confidently use sed, awk, perl, ksh or whatever to do string manipulation using these characters without constantly having to guess and experiment with what has to be escaped.

Thanks so much!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix driving me crazy

:( :confused: what is performed by the following unix command: grep -v Jane project1.txt and grep ' 5\..' janet.txt (1 Reply)
Discussion started by: Tendernisin
1 Replies

2. 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

3. 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

4. Shell Programming and Scripting

Pleas help..this is driving me crazy

Hi, I've created a script in csh that takes a file and checks it for mispelled words. Im almost done but I need to do two more things but I need help. First, when displaying an incorrect word to the user, I need to show the line of the input file that contains the word. Second,if the user... (0 Replies)
Discussion started by: hckygoli31
0 Replies

5. Shell Programming and Scripting

PERL cgi script... extra character driving me crazy

I'm using a PERL cgi script that uses rrdtool to make graphs. I can't get the syntax correct to use a degree sign (alt+0176 like this °) and also using a variable. If I use single quotes, I can't call the variable. If I use double quotes, there is an extra symbol (Â) before the ° which goes... (2 Replies)
Discussion started by: audiophile
2 Replies

6. UNIX for Dummies Questions & Answers

Variable with @ sign is driving me crazy

Ok so I am working on a command that is going to do a Dig @ a certain IP address which is enclosed in a variable. Now I thought I had this figure out because it works. The problem is that it does not ALWAYS work. the variable is IP=192.168.1.1 the commands I have tried are dig... (2 Replies)
Discussion started by: MrEddy
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. UNIX for Dummies Questions & Answers

UNIX/Linux/Distributions - driving me crazy...

Hello there, first of all: I do not want to become a hacker. you cannot do that. you cannot learn that from a book. Don't think I'm some kind of a script-kiddie. now that's settled let's start. I've been trying around with a lot of OS lately. I have backtrack5 installed on my notebook,... (10 Replies)
Discussion started by: Dr. Nick
10 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
ASN1_STRING_print_ex(3) 					      OpenSSL						   ASN1_STRING_print_ex(3)

NAME
ASN1_STRING_print_ex, ASN1_STRING_print_ex_fp - ASN1_STRING output routines. SYNOPSIS
#include <openssl/asn1.h> int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); int ASN1_STRING_print(BIO *out, ASN1_STRING *str); DESCRIPTION
These functions output an ASN1_STRING structure. ASN1_STRING is used to represent all the ASN1 string types. ASN1_STRING_print_ex() outputs str to out, the format is determined by the options flags. ASN1_STRING_print_ex_fp() is identical except it outputs to fp instead. ASN1_STRING_print() prints str to out but using a different format to ASN1_STRING_print_ex(). It replaces unprintable characters (other than CR, LF) with '.'. NOTES
ASN1_STRING_print() is a legacy function which should be avoided in new applications. Although there are a large number of options frequently ASN1_STRFLAGS_RFC2253 is suitable, or on UTF8 terminals ASN1_STRFLAGS_RFC2253 & ~ASN1_STRFLAGS_ESC_MSB. The complete set of supported options for flags is listed below. Various characters can be escaped. If ASN1_STRFLGS_ESC_2253 is set the characters determined by RFC2253 are escaped. If ASN1_STR- FLGS_ESC_CTRL is set control characters are escaped. If ASN1_STRFLGS_ESC_MSB is set characters with the MSB set are escaped: this option should not be used if the terminal correctly interprets UTF8 sequences. Escaping takes several forms. If the character being escaped is a 16 bit character then the form "WXXXX" is used using exactly four characters for the hex representa- tion. If it is 32 bits then "UXXXXXXXX" is used using eight characters of its hex representation. These forms will only be used if UTF8 conversion is not set (see below). Printable characters are normally escaped using the backslash '' character. If ASN1_STRFLGS_ESC_QUOTE is set then the whole string is instead surrounded by double quote characters: this is arguably more readable than the backslash notation. Other characters use the "XX" using exactly two characters of the hex representation. If ASN1_STRFLGS_UTF8_CONVERT is set then characters are converted to UTF8 format first. If the terminal supports the display of UTF8 sequences then this option will correctly display multi byte characters. If ASN1_STRFLGS_IGNORE_TYPE is set then the string type is not interpreted at all: everything is assumed to be one byte per character. This is primarily for debugging purposes and can result in confusing output in multi character strings. If ASN1_STRFLGS_SHOW_TYPE is set then the string type itself is printed out before its value (for example "BMPSTRING"), this actually uses ASN1_tag2str(). The content of a string instead of being interpreted can be "dumped": this just outputs the value of the string using the form #XXXX using hex format for each octet. If ASN1_STRFLGS_DUMP_ALL is set then any type is dumped. Normally non character string types (such as OCTET STRING) are assumed to be one byte per character, if ASN1_STRFLAGS_DUMP_UNKNOWN is set then they will be dumped instead. When a type is dumped normally just the content octets are printed, if ASN1_STRFLGS_DUMP_DER is set then the complete encoding is dumped instead (including tag and length octets). ASN1_STRFLGS_RFC2253 includes all the flags required by RFC2253. It is equivalent to: ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN ASN1_STRFLGS_DUMP_DER SEE ALSO
X509_NAME_print_ex(3), ASN1_tag2str(3) HISTORY
TBA 0.9.7d 2003-11-20 ASN1_STRING_print_ex(3)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy