Find the answer to your Linux question:
Results 1 to 6 of 6
Hi , how can I display ascii characters in shell scripting or in terminal window. because I need to display the boxes and lines in my scripting program. Some where ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! prasannaraja's Avatar
    Join Date
    Jun 2005
    Posts
    7

    How to Display ASCII character using shell Scripts?


    Hi ,

    how can I display ascii characters in shell scripting or in terminal window. because I need to display the boxes and lines in my scripting program.

    Some where I have heared that by using escape sequence i.e ctl+v then esc key and then some 3 digit number could give me an ascii display corresponding to that numbers.please see the bellow link.i want to display these symbols.

    thanks

    http://img223.echo.cx/img223/650/ascii4kq.gif

  2. #2
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    '\<octal number here>'

    is probably what you want

    Example output a tab control character:

    echo '\011' hi there
    output:
    Code:
          hi there

  3. #3
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    Prasannaraja try typing printf '\033(0' ; printf '\033)0'
    Now try typing some random characters.Does
    everything look weird ? That's because you've switched
    to an alternate font set.I assume that's what you're looking for.
    Now type printf '\033c' to bring everything back to normal.
    (On some distros reset will have the same result.)

    If your system has a console_codes man page you'll
    find more details in there.But I don't think there is any
    guarantee what the alternate font sets will look like on your
    system.So it is not certain they will look like that gif you linked to.

    Outputing escape sequences to the terminal involves "printing"
    unprintable characters.Both printf and echo can be used for that
    sort of thing with printf being more flexible.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined! prasannaraja's Avatar
    Join Date
    Jun 2005
    Posts
    7
    Hi Santa

    Thanks for your help, it was very usefull for me to get it. But i have a du't i am able to get the ascii characters but how to get the exact ascii value characters according to the web page which I have shown you eariler

    http://img223.echo.cx/img223/650/ascii4kq.gif

  6. #5
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    As I said above
    But I don't think there is any
    guarantee what the alternate font sets will look like on your
    system.So it is not certain they will look like that gif you linked to.
    So in other words you may not be able to get them.But I'm not sure.
    My only suggestion is that you try all different fonts and see
    if you get what you want.

  7. #6
    Just Joined! prasannaraja's Avatar
    Join Date
    Jun 2005
    Posts
    7
    Thanks for your suggestiongs i have got them...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •