LinuxQuestions.org
Help answer threads with 0 replies.
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 07-20-2011, 10:36 AM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
quick numeric conversion on the command line?


What is the quickest way, from the command line, to convert:

Ip address --> Binary --> Base64

I've been using an online calculator to do this, but I have need to script it now, so having it in a single command would be great.
 
Old 07-20-2011, 10:48 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I think you could use ipcalc for the IP -> Binary conversion. Maybe an additional pipe to bc can handle the binary -> base64?
 
Old 07-20-2011, 11:21 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,126

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
I typically write a little perl one-liner for conversions like this and put it in my ~/bin directory.
Perl has Net::IP and MIME:Base64 modules.
 
  


Reply


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
Batch file conversion command? the same command on all files in a folder ? pete2222 Linux - General 6 10-02-2010 11:59 AM
quick question on emailing from the command line boyd98 Linux - General 2 04-29-2007 09:38 PM
command line text to pdf conversion waskelton4 Linux - Software 4 02-14-2005 05:38 PM
Simple / quick GUI on the command line ? michael_util Programming 3 01-05-2005 05:08 PM
Quick Q: Command to print line number X? KneeLess Linux - Software 1 05-27-2004 07:49 PM

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

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