Sponsored Content
Full Discussion: Ascii to caracter
Top Forums Shell Programming and Scripting Ascii to caracter Post 302169582 by flame_eagle on Thursday 21st of February 2008 03:57:29 PM
Old 02-21-2008
Ascii to caracter

Hi,

I'm trying to get from "a" to "b". So far, I've been able to get the ascii code for "a" and from there to get the code for "b". But, and this is were I'm stuck, I can't find how to show the symbol associated with the code I calculated. This is what I have right now

Code:
test=a
valeur=`printf %u "'$test"`
char=`expr $valeur + 1`
printf %c $char

It outputs "9" and I want to get "b"
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

ASCII file

I've been having trouble trying to read an ASCII file. I'm on an IRIX machine, by the way. I've tried "cat" and I get a bunch of unreadable text, and the "string" command gets the "Command not Found" error. Please advise. Thanks. (1 Reply)
Discussion started by: sherbet808
1 Replies

2. UNIX for Dummies Questions & Answers

ascii

a silly question but is there a way to display individual ascii values say if i type 65 it will display the letter instead? thanks fo any help. (3 Replies)
Discussion started by: melkor
3 Replies

3. Programming

Extended ascii

Hi all, I would like to change the extended ascii code ( 128 - 255). I tried to change LC_ALL and LANG in current session ( values from locale -a) and for no good. Thanks. (0 Replies)
Discussion started by: avis
0 Replies

4. Shell Programming and Scripting

code ASCII for Caracter -->> '

I'm a question: the expresiion 'expr $a +1' use the caracter --> ' (is not shift+ ? !!!) what is the code ascii for generate this caracter ?????? tank's (3 Replies)
Discussion started by: ZINGARO
3 Replies

5. Shell Programming and Scripting

binary to ascii

Hi, Is there a way to convert the binary file to ascii . the binary file is pipe delimited. from source the file(pipe delimited) is ftped to mainframe and from mainframe it is ftped to the unix box using binary format. Is there a way to change it back to ascii and view it? Thanks! (3 Replies)
Discussion started by: dnat
3 Replies

6. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

7. Shell Programming and Scripting

Delete a line last caracter

Hello dears, I have a CVS file in wich a have many lines. each line is ended by this two caracters ';;'. I want to get a new format of this file by deleting this caracters which unix shell script eg. of input file: a;b;c;d;; a;b;c;; a;b;; a;b;c;d;e;; That means each line lenght can... (2 Replies)
Discussion started by: yeclota
2 Replies

8. Programming

Hexadecimal to ascii

Let's suppose i have a hexadecimal array with 16 cells.for example b3e2d5f636111780 i want to convert it to an array of ascii characters(in C) so that i can reduce total size of the file i want to put it in. But i am afraid i have not fully understand the difference between ascii and hex(i... (3 Replies)
Discussion started by: bashuser2
3 Replies

9. Shell Programming and Scripting

bash ascii

hi guys In my bash script I need to use ascii characters such as SYN(22) and US(31). How do I echo them? (3 Replies)
Discussion started by: vlm
3 Replies

10. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies
ASCII(1)							 Development Tools							  ASCII(1)

NAME
ascii - report character aliases SYNOPSIS
ascii [-dxohv] [-t] [char-alias...] OPTIONS
Called with no options, ascii behaves like `ascii -h'. Options are as follows: -t Script-friendly mode, emits only ISO/decimal/hex/octal/binary encodings of the character. -s Parse multiple characters. Convenient way of parsing strings. -d Ascii table in decimal. -x Ascii table in hex. -o Ascii table in octal. -h, -? Show summary of options and a simple ASCII table. -v Show version of program. DESCRIPTION
Characters in the ASCII set can have many aliases, depending on context. A character's possible names include: * Its bit pattern (binary representation). * Its hex, decimal and octal representations. * Its teletype mnemonic and caret-notation form (for control chars). * Its backlash-escape form in C (for some control chars). * Its printed form (for printables). * Its full ISO official name in English. * Its ISO/ECMA code table reference. * Its name as an HTML/SGML entity. * Slang and other names in wide use for it among hackers. This utility accepts command-line strings and tries to interpret them as one of the above. When it finds a value, it prints all of the names of the character. The constructs in the following list can be used to specify character values. If an argument could be interpreted in two or more ways, names for all the different characters it might be are dumped. character Any character not described by one of the following conventions represents the character itself. ^character A caret followed by a character. character A backslash followed by certain special characters (abfnrtv). mnemonic An ASCII teletype mnemonic. hexadecimal A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit characters (01234567890abcdef). To ensure hex interpretation use hexh, 0xhex, xhex or xhex. decimal A decimal sequence consists of one, two or three decimal digit characters (0123456789). To ensure decimal interpretation use ddecimal, ddecimal, or ddecimal. octal An octal sequence consists of one, two or three octal digit characters (01234567). To ensure octal interpretation use octal, 0ooctal, ooctal, or ooctal. bit pattern A bit pattern (binary) sequence consists of one to eight binary digit characters (01). To ensure bit interpretation use 0bbit pattern, bbit pattern or bit pattern. ISO/ECMA code A ISO/ECMA code sequence consists of one or two decimal digit characters, a slash, and one or two decimal digit characters. name An official ASCII or slang name. The slang names recognized and printed out are from a rather comprehensive list that first appeared on USENET in early 1990 and has been continuously updated since. Mnemonics recognized and printed include the official ASCII set, some official ISO names (where those differ) and a few common-use alternatives (such as NL for LF). HTML/SGML entity names are also printed when applicable. All comparisons are case-insensitive, and dashes are mapped to spaces. Any unrecognized arguments or out of range values are silently ignored. Note that the -s option will not recognize 'long' names, as it cannot differentiate them from other parts of the string. For correct results, be careful to stringize or quote shell metacharacters in arguments (especially backslash). This utility is particularly handy for interpreting cc(1)'s ugly octal `invalid-character' messages, or when coding anything to do with serial communications. As a side effect it serves as a handy base-converter for random 8-bit values. AUTHOR
Eric S. Raymond esr@snark.thyrsus.com; November 1990 (home page at http://www.catb.org/~esr/). Reproduce, use, and modify as you like as long as you don't remove this authorship notice. Ioannis E. Tambouras <ioannis@debian.org> added command options and minor enhancements. Brian J. Ginsbach <ginsbach@sgi.com> fixed several bugs and expanded the man page. David N. Welton <davidw@efn.org> added the -s option. Matej Vela corrected the ISO names. Dave Capella contributed the idea of listing HTML/SGML entities. ascii 03/26/2011 ASCII(1)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy