LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Closed Thread
  Search this Thread
Old 01-12-2012, 01:00 AM   #1
rakesh.bharad
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

Eg.

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

Thanks
Rakesh
 
Old 01-12-2012, 06:54 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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 http://www.linuxquestions.org/questi...ersion-923390/
 
  


Closed Thread

Tags
ascii, char, conversion



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 02:00 PM
1 byte = 1 ASCII char? ghostdancer Programming 6 11-02-2007 08:42 PM
[C] char <=> ASCII-Code Cornholio Programming 7 03-06-2005 02:40 PM
sending extended ASCII char to serial fbarre Programming 4 04-20-2004 08:28 PM
ASCII char mapping tlennon Linux - Newbie 0 03-05-2001 07:10 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:14 PM.

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