Converting numbers to strings and strings to numbers Score: 4.1/5 (935 votes) Converting numbers to text and vice versa is a common issue as it can be useful in many different situations and C98 doesn't provide a tool designed specifically to solve this problem.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Today!Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.Are you new to LinuxQuestions.org? Visit the following links: If you have any problems with the registration process or your account login, please. If you need to reset your password,.Having a problem logging in? Please visit to clear all LQ-related cookies.
Introduction to Linux - A Hands on GuideThis guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.to receive this Complete Guide absolutely free. Lets say i want to convert a string '76' to integer76.
How would I do this in BASH?I remember in Pascal I could do something like char ('7')+39or some such, and that would convert between character and a numbercorresponding to that character. Can't seem to be able to figurethis out in BASH. What I actually wanted to do was to comparetwo numbers one of which I got from top command. I finallyfigured out that I could compare two strings as well, so the problemis solved. But it would be nice to know how to convert betweenintegers and strings.thanks a bunch in advance. Lets say i want to convert a string '76' to integer76. How would I do this in BASH?I remember in Pascal I could do something like char ('7')+39or some such, and that would convert between character and a numbercorresponding to that character.
Can't seem to be able to figurethis out in BASH. What I actually wanted to do was to comparetwo numbers one of which I got from top command. I finallyfigured out that I could compare two strings as well, so the problemis solved. But it would be nice to know how to convert betweenintegers and strings.thanks a bunch in advance.Data types are not declared for bash script.