samedi 5 avril 2014

SH - Alternative à printf du mksh Android ? -Débordement de pile


I'm writing a shell script to be run on Android's mksh. In Bash, I can do the following:


printf -v NUMBER "%d" \'"$CHARACTER"

The command above converts $CHARACTER into a signed decimal NUMBER. But mksh does not support printf. Is there an alternative solution that just use mksh / ksh's internal commands?



I'm writing a shell script to be run on Android's mksh. In Bash, I can do the following:


printf -v NUMBER "%d" \'"$CHARACTER"

The command above converts $CHARACTER into a signed decimal NUMBER. But mksh does not support printf. Is there an alternative solution that just use mksh / ksh's internal commands?


0 commentaires:

Enregistrer un commentaire