科学网

 找回密码
  注册
Convert the string to number and compare
沈旭章 2012-2-1 15:19
Use bc $ echo "0.8 0.7" | bc 1 $ echo "0.8 0.7" | bc 0 $ echo ".08 0.7" | bc 0 use awk x = "0.80" y = "0.70" result = $ ( awk - vx = $x - vy = $y 'BEGIN{ print x=y?1:0}' ) if ; then echo ...
个人分类: Shell scripts|2688 次阅读|没有评论
check the existance of a directory in a bash shell
沈旭章 2012-2-1 15:18
To check if a directory exists in a bash shell script you can use the following: if ; then # Control will enter here if $DIRECTORY exists fi Or to check if a directory doesn't exist: if ; then # Control will enter here if $DIRECTORY doesn't exist fi if ; then i ...
个人分类: Shell scripts|2921 次阅读|没有评论
RF_Prog
沈旭章 2010-6-16 16:45
Tools of RF (Move out, Migration, Image) Why can't upload the attachment
个人分类: Host_Page|3227 次阅读|没有评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-9-21 09:14

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部