translate ascii-characters
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > translate ascii-characters




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    translate ascii-characters  
Martin Klar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-07 06:23 PM

Hi NG,

I need a script which translates
a character, e.g. A to  its ascii-value (65).
The script has to cope with A-Z.

Thank you for your answers.

Regards, Martin





[ Post a follow-up to this message ]



    Re: translate ascii-characters  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-07 06:23 PM

2007-01-23, 18:04(+01), Martin Klar:
>    Hi NG,
>
>    I need a script which translates
>    a character, e.g. A to  its ascii-value (65).
>    The script has to cope with A-Z.
>
>    Thank you for your answers.
[...]

printf '%d\n' "'A"

also with zsh:

print $((##A))

or:

var=A
print $((#var))

--
Stéphane





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:58 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register