|
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. | NEI PREFERITI | .:: | RSS Forum | RSS News | NEWS web | NEWS software | |
| PUBBLICITA' | | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | | CERCA nel FORUM » | |
06-02-2008, 14.04.44 | #1 |
Senior Member
Registrato: 01-03-2006
Messaggi: 249
|
[LINUX] Bash - controllo parametro
___________________________________
1 + 1 = 3, for large values of 1. |
06-02-2008, 16.14.37 | #2 |
Young Promise
Registrato: 04-02-2006
Messaggi: 2.114
|
Tratto da qua: http://www.adunanza.net/forum/showthread.php?t=47883
Codice:
isdigit () # Tests whether *entire string* is numerical. { # In other words, tests for integer variable. [ $# −eq 1 ] || return $FAILURE case $1 in *[!0−9]*|"") return $FAILURE;; *) return $SUCCESS;; esac } |
06-02-2008, 16.32.56 | #3 |
Senior Member
Registrato: 01-03-2006
Messaggi: 249
|
Secondo te è più elegante la tua soluzione o
Codice:
if echo ${var[$i]} | grep -q "[^0-9]" then echo "Il valore deve essere di tipo numerico intero positivo."
___________________________________
1 + 1 = 3, for large values of 1. |
06-02-2008, 20.04.29 | #4 | |
Young Promise
Registrato: 04-02-2006
Messaggi: 2.114
|
Quota:
|
|
Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti) | |
Strumenti discussione | |
|
|
Discussioni simili | ||||
Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
[Linux] Script bash | melarco | Linux e altri Sistemi Operativi | 3 | 14-02-2008 22.02.06 |
[LINUX] Applicazione per controllo carica batteria | Downloader | Linux e altri Sistemi Operativi | 6 | 16-10-2006 13.04.29 |
[Linux] GNU GRUB passare un parametro per il boot | UG0_BOSS | Linux e altri Sistemi Operativi | 6 | 06-09-2006 13.13.14 |
[LINUX] Bash script & Cron | NS-1 | Linux e altri Sistemi Operativi | 3 | 25-07-2005 15.02.36 |
[LINUX] controllo ortografico | sacarde | Linux e altri Sistemi Operativi | 2 | 10-07-2005 18.45.17 |