LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-08-2013, 09:18 AM   #1
kptkill
LQ Newbie
 
Registered: Apr 2007
Posts: 20

Rep: Reputation: 0
whitespace character from base64 decode


Hello All,

I'm getting an unexpected white space character when I run the following command:
echo "FglqZmpvLjo="|openssl base64 -d

Code:
"        jfjo.:"  (no quotes)
However, running that string back though base64 does not return the same value.
If I run this:echo "FglqZmpvLjo="|openssl base64 -d > temp.txt
and open in vim, I see
Code:
"^V      jfjo.:"  Again no quotes
Can anyone explain this issue?

Thanks!
 
Old 03-08-2013, 10:54 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
What output you want? Do you want ("} symbol to be printed?
 
Old 03-08-2013, 11:36 AM   #3
kptkill
LQ Newbie
 
Registered: Apr 2007
Posts: 20

Original Poster
Rep: Reputation: 0
The question is why is it outputting that whitespace? its not a space, its not a tab... I don't know what "^V " is. The true reason is this is only part of a script. Each character is then inputed into a for loop. obviously, the for loop doesn't like the whitespace as I've coded it, but I can't work around the problem without knowing what character it is outputting.

According to Wikipedia, ^V is a Synchronous idle. I'm not understanding.
 
Old 03-08-2013, 12:34 PM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by kptkill View Post
The question is why is it outputting that whitespace?...
That is what is encoded by the input "FglqZmpvLjo=". It's really a non-printable byte, not whitespace. That's why if you just look at the output in the terminal it seems like the ^V byte is not there.

Quote:
According to Wikipedia, ^V is a Synchronous idle. I'm not understanding.
That name refers to old systems that used this byte in a certain way; you should simply consider it a byte with value 22.

Quote:
The true reason is this is only part of a script. Each character is then inputed into a for loop. obviously, the for loop doesn't like the whitespace as I've coded it, but I can't work around the problem without knowing what character it is outputting.
Actually, you can code your script such that it can handle any input (except for 0 (aka NUL) bytes) by quoting properly.
 
  


Reply



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
procmailrc decode data from base64 encoded emails - trying to decode with uudeview garyrickert Linux - Software 6 10-06-2015 03:41 PM
[SOLVED] decode a non latin character string utf8 ted_chou12 Linux - Newbie 3 12-12-2011 02:54 PM
C++ string object; add whitespace controll character sureshkellemane Programming 5 01-13-2009 06:31 PM
Base64 decode to image in python genderbender Programming 0 09-06-2006 04:20 PM
BASE64 APIs? EddyHahn Programming 0 11-29-2004 09:59 PM

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

All times are GMT -5. The time now is 10:01 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