- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: want a64l like function in shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 06:44 AM
08-16-2011 06:44 AM
Dear all,
please suggest if there is any utility in shell script to do the function of a64l.
I need to convert the 64based ascii password characters to interger.
Any available utility or methods? Please advise.
Thanks and Regards
Kang
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:04 AM
08-16-2011 07:04 AM
Re: want a64l like function in shell script
Hi:
I believe that you are going to have to write your own C code using 'a64l(3C)' :
http://bizsupport.austin.hp.com/bc/docs/support/SupportManual/c02252931/c02252931.pdf
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 09:28 PM
08-16-2011 09:28 PM
Re: want a64l like function in shell script
thanks. but I must deal with it in shell script.
I only need to decode at most 1 character in one time, not too complicated, and I am thinking a couple of possible solutions
1 create an array containing all base64 ascii which is "./0-9A-Za-z", then use cut to extract ervery single char and compare it with input to decide the index, which will be the wanted integer
2 devide 64base ascii into 5 categories
. for 0
/ for 1
0-9: simply plus 2 for 2-11
A-Z: convert it to ASCII(65-90) and minus 53 for 12-37
a-z: convert it to ASCII(97-122) and minus 59 for 38-63
3 use some utility to tell the index of input character in string"./0-9A-Za-z"
I don't know if shell has such an utility. I though about grep, sed, awk and not find any way to do it.
Do you know any tool to achieve such a task?
regards
kang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2011 02:02 AM - edited 08-17-2011 02:03 AM
08-17-2011 02:02 AM - edited 08-17-2011 02:03 AM
Solution>3 use some utility to tell the index of input character in string"./0-9A-Za-z"
>I thought about grep, sed, awk and not find any way to do it.
grep -n can do it but would be expensive. ;-)
But you can use awk's index:
awk -v char=$char '
BEGIN {
print index("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", char)-1;
exit 0
} ' /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2011 02:27 AM
08-17-2011 02:27 AM