|
Programming Escape CharactersThis page examines the nuances of escape characters used in C and Java program coding.
| Related:
|
Escape characters
See http://www.asciitable.com/ or http://www.table-ascii.com.
PHP programs also need escaped dollars signs (which precede variable names), braces, and brackets (which have special meaning in PHP): In DOS batch files, the character like the backslash in Linux is the carrot, which tells the command interpreter to see the next character as a conventional character. An example usage is this: @echo off set username=josh echo ^<%username%@mail.com^> >> emaillist.txt |
End of Line characters
Within UNIX, convert DOS newlines (CR/LF) to Unix format with this regular expression command:
sed 's/.$//' file # assumes that all lines end with CR/LF
Within DOS, convert Unix newlines (LF) to DOS \r\n format with one of these two regular expression commands:
sed 's/$//' file # method 1
sed -n p file # method 2 Use this standard utility:
dos2unix fromfile1 tofile
Flip-xp.exe is a FREE command-line utility you can download to your Windows\System32 folder to display (-t) or convert ASCII files to Unix (-u) or to Windows (-d) or to Macintosh (-m). |
Setting Escape characters
So to store a string such as "Johnson & Son" into an Oracle table, use an escape character, as in 'Johnson \& Son' (with the \&). But first turn on escape character processing:
SQL> set escape \
|
Use in UNIX Shells
|
Thank you! |