skip to main
|
skip to sidebar
Fedora已死(理想主义的光辉瞬间湮灭)-To be continued
Fedora笔记, BIOS笔记, 还有一些牢骚
20101014
Bash: checking if a variable is a number
[code]
# v=1
# [ $v -eq $v ]
# echo $?
0
# v=a
# [ $v -eq $v ]
# echo $?
2
[/code]
Note: "-eq" compares number, but not string.
Ref:
http://snippets.dzone.com/posts/show/3143
没有评论:
发表评论
较新的博文
较早的博文
主页
订阅:
博文评论 (Atom)
标签
牢骚
(11)
ACPI
(5)
aMule
(1)
android
(1)
ANTLR
(1)
Apache
(6)
apt
(1)
backup
(6)
BIOS
(8)
browser
(4)
c
(8)
CSS
(1)
debian
(1)
DOS
(2)
drupal
(1)
e17
(1)
eclipse
(2)
ems
(1)
Excel
(1)
extjs
(2)
Fedora
(14)
filesystem
(1)
Firefox
(12)
FVWM
(1)
gfw
(3)
GNU
(2)
Google
(8)
hacker
(3)
hardware
(2)
HTML
(2)
IE
(1)
Javascript
(4)
js
(3)
Linux
(34)
linux tips
(1)
locale
(1)
man
(1)
MASM
(11)
Matlab
(1)
mobile phone
(2)
mother board
(4)
music
(1)
mysql
(1)
network
(6)
opensource
(9)
PHP
(7)
rpm
(1)
Shell
(2)
SVN
(11)
tips
(3)
ubuntu
(6)
UltraEdit
(2)
Ununtu
(6)
vbox
(1)
vim
(2)
web
(1)
website
(4)
Windows
(8)
广告位
没有评论:
发表评论