ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
AFAIK it is not possible (for good reasons) so the solution is to sanity-check variable values before using them in a way that might cause problems. What do you want your program to do if $n is non-integer? If you want to do arithmetic on values that may be non-integer, the usual solution is to use bc.
AFAIK it is not possible (for good reasons) so the solution is to sanity-check variable values before using them in a way that might cause problems. What do you want your program to do if $n is non-integer? If you want to do arithmetic on values that may be non-integer, the usual solution is to use bc.
Actually, I am trying to do the reverse of a number through bash scripting. For integer values its working fine but for non integer values it's giving a error message.
I think we can suppress the error messages as well as the warning messages by running the command as fallows: "Command Sequence 2>filename". For Example:
Actually, I am trying to do the reverse of a number through bash scripting. For integer values its working fine but for non integer values it's giving a error message.
Can you explain what you mean by "the reverse of a number"? You mean 12345 should become 54321?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.