bash ascii


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash ascii
# 1  
Old 06-07-2012
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?
# 2  
Old 06-07-2012
Use printf instead...
# 3  
Old 06-07-2012
Quote:
Originally Posted by Scrutinizer
Use printf instead...
Could you give me an example?
# 4  
Old 06-07-2012
SYN(22)
Code:
# echo -en "\x16"

US(31)
Code:
# echo -en "\x1F"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. 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

3. Shell Programming and Scripting

Bash - binary data to ascii code

Hello, With bash-script (ubunto server) I'm trying to read a binary file and, for each character, give back its ascii code (including extended ascii). For example: HEX => ASCII => PRINT f5 => 245 => ő 50 => 80 => P To load the binary file into a variable I tried in this way: ... (2 Replies)
Discussion started by: math4
2 Replies

4. Shell Programming and Scripting

[BASH] Lining ascii boxes up next to each other

Hello all, I'm writing a simple little game to get myself back into BASH, but am getting unstuck with some formatting. I have the following code: let len=${#binary} for ((j=0; j < len; j++)) do echo "+-----+" echo "| ${binary:j:1} |" echo ... (8 Replies)
Discussion started by: whyte_rhyno
8 Replies

5. Shell Programming and Scripting

Preserve extented ascii character when run echo comand inside bash script

Hi everyone, I'm echo some text with extended ascii characters as below: echo -e "Pr\xE9sentation du spectacle" > output or echo -e "Présentation du spectacle" > outputIf I open the file created I see this text Présentation du spectacleThe text is shown correctly in this created file when... (7 Replies)
Discussion started by: Ophiuchus
7 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

URL to ASCII

I am writing a small script to help me clean out my music (itunes) that has somehow doubled every song. Using the itunes.xml file, I have been able to create a simple list of all the files. The problem is itunes uses URL style formatting, ex. %20 for spaces. I used sed to convert %20 to a space... (5 Replies)
Discussion started by: imagiro1
5 Replies

8. UNIX for Advanced & Expert Users

Processing extended ascii character file names in UNIX (BASH scipts)

Hi, I have a accentuated letter (ö) in a script for an Installer. It's a file name. This is not working and I'm told to try using the octal value for the extended ascii character. Does anyone no how to do this? If I had the word "filförval", can I just put in the value between the letters, like... (9 Replies)
Discussion started by: peli
9 Replies

9. 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

10. 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
Login or Register to Ask a Question