摘要:Ruby中的public、protected和private 栗子1: class Person public def my_public_method 'I am a public method' end protected def my_protected_method 'I am a prot
阅读全文
摘要:循环时的注意事项 循环做什么 停止循环的条件是什么 Ruby实现循环的方法 times while each for until loop times方法 "满地油菜花" "满地油菜花" "满地油菜花" "满地油菜花" "满地油菜花" "满地油菜花" "满地油菜花" shijianzhongdeMa
阅读全文
摘要:条件判断 if unless case 比Python复杂,Python就一个if 32 shijianzhongdeMacBook-Pro:chapter_5 shijianzhong$ cat ad2pingcheng.rb ad = ARGV[0].to_i pingcheng = ad -
阅读全文
摘要:for命令 基本语法格式 for var in list do commands done 也可以写成 for var in list; do commands done 读取列表中的值 shijianzhongdeMacBook-Pro:part_13 shijianzhong$ ./test1
阅读全文
摘要:linux grep命令详解 简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。 Unix的grep家
阅读全文
摘要:12.1使用if-then语句 最基本的结构化命令 if command then command fi 这里的command必须exit的返回值是0 shijianzhongdeMacBook-Pro:part_12 shijianzhong$ ./test1.sh /Users/shijianz
阅读全文
摘要:学习一个指令,最好从官方文档看: 官网地址:http://www.gnu.org/software/coreutils/manual/html_node/nohup-invocation.html#nohup-invocation nohup 不挂断的运行 runs the given comman
阅读全文