troubleshooting Question

Error while assigning a character value to a numeric variable

Avatar of gram77
gram77Flag for India asked on
Unix OSLinux
8 Comments1 Solution220 ViewsLast Modified:
I have a script that uses a numeric variable resA.

#!/bin/ksh
typeset -i resA=1,233

It has to be an integer type variable, however, it's value assigned is character.

So it gives an error:

$> ksh -x run.ksh
+ typeset -i resA=1,22
run.ksh[2]: 1,22: syntax error

How do I change 1,22 into a number 122 in korn shell?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros