Bloc-note d'un développeur web
Dans : Snippets
6 mar 2010Bash n’offre pas de fonction pour convertir une chaîne de caractères ou un nombre flottant en un entier. Cela n’est toute fois pas impossible, il suffit de faire appel à printf1 et le tour est joué !
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #!/usr/bin/env bash # string_to_int.sh - Shell script to convert a string or float number # to an integer. function string_to_int () { […]
Continuer la lecture de l'article « Bash : convertir un string en entier »
Commentaires récents