LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-17-2013, 09:26 AM   #1
froff
Member
 
Registered: Nov 2005
Location: Poland
Distribution: Mint Mate, Ubuntu
Posts: 47

Rep: Reputation: 1
Question Any way to substitute one character with couple of characters using tr program?


Hello
I need simple encoding conversion in bash script.
But I need to convert to UTF-8 where national characters consist of two bytes.
Is there any way make such substitution with tr ?
 
Old 12-17-2013, 10:06 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,269

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
tr only works with single-byte characters. Use a recent version of sed instead.
 
1 members found this post helpful.
Old 12-17-2013, 03:43 PM   #3
froff
Member
 
Registered: Nov 2005
Location: Poland
Distribution: Mint Mate, Ubuntu
Posts: 47

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by smallpond View Post
tr only works with single-byte characters. Use a recent version of sed instead.
Thanks! I see I have to refector some scripts.
 
  


Reply

Tags
tr


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
substitute characters in a continuous log file oneindelijk Linux - Newbie 16 10-16-2012 08:57 AM
[SOLVED] how to split a string of characters after nth character samanp Programming 2 08-15-2012 03:59 PM
Substitute 2 character country abbreviations to 3 hattori.hanzo Programming 4 12-23-2010 01:10 AM
[SOLVED] sed substitute everything until character sqn Programming 5 03-30-2010 11:27 AM
Program to substitute colors in image Wynd Linux - Software 1 02-07-2004 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:26 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration