![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check for a particular character inside a file and substitute with a given character? | karthikprasathk | AIX | 1 | 07-01-2008 12:29 AM |
| read a variable character by character, substitute characters with something else | vipervenom25 | UNIX for Dummies Questions & Answers | 2 | 06-06-2008 12:18 PM |
| Processing extended ascii character file names in UNIX (BASH scipts) | peli | UNIX for Advanced & Expert Users | 9 | 04-06-2008 02:17 PM |
| Non-ascii character detection (perl or grep) | srinivasan_85 | UNIX for Dummies Questions & Answers | 9 | 02-20-2007 05:38 AM |
| ASCII character to accept logon password | gord | UNIX for Dummies Questions & Answers | 8 | 02-02-2006 12:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
Quote:
Quote:
Quote:
Quote:
|
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Quote:
Code:
printf "%d\n" "'AB" printf: 3016-002 'AB is not completely converted. 65 |
|
#10
|
|||
|
|||
|
Quote:
Code:
printf "%d\n" "'AB" printf: 'AB not completely converted 65 |
|
#11
|
|||
|
|||
|
Actually, I just found this out.
In csh and ksh the output is as I've shown above. However, in bash it's this... Code:
printf "%d\n" "'AB" 65 |
|
#12
|
|||
|
|||
|
If Perl is acceptable, it offers the ord() function for returning the character code of a single character. When invoked on a multi-character string, it simply returns the character code of the first character of the string.
Code:
perl -le 'print ord(shift)' A |
|
#13
|
|||
|
|||
|
Quote:
Code:
printf "%d\n" "'AB" 65 |
|||
| Google The UNIX and Linux Forums |