Visit the LQ Articles and Editorials section
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.


Closed Thread
  Search this Thread
Old 01-12-2012, 02:00 AM   #1
LQ Newbie
Registered: May 2011
Posts: 3

Rep: Reputation: 0
Smile Ascii to Char and Char to Ascii conversion

I am completely new to Unix scripting with zero knowledge in it and have the below scenario can you please help me with the complete working script,

First script,

1. Get the string input from the user
2. Convert it to ASCII
3. Increment each character's ASCII value by 2. If the input value contains Y or Z it should be converted to A or B accordingly, same way the string may have special characters and numbers as well and they must be converted accordingly.
4. Form the new word
5. Store this in a file


Input : ABCD
Output : CDEF

and this output should be stored at the Value 1 location in a file like,

Value 1 : CDEF
Value 2 : XYX

This file will act as a config file and should be used in another script 2

Script 2 should read these values and before proceeding it should convert it back to original value (i.e. ABCD - should perform the reverse operation).

This is something like encrypting and decryption but its very primary. I am not worried about any security issues by achieving this logic as i am going to implement it on some log files with no value.

I am on solaris 5.10

Old 01-12-2012, 07:54 AM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,571

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of

Closed Thread

ascii, char, conversion

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
python: converting a 3 character octal string into and ASCII char llama_meme Programming 1 07-06-2010 03:00 PM
1 byte = 1 ASCII char? ghostdancer Programming 6 11-02-2007 09:42 PM
[C] char <=> ASCII-Code Cornholio Programming 7 03-06-2005 03:40 PM
sending extended ASCII char to serial fbarre Programming 4 04-20-2004 09:28 PM
ASCII char mapping tlennon Linux - Newbie 0 03-05-2001 08:10 PM

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration