发布时间:2018-03-17 10:34:09
例子:#!/bin/bash printf "Where are you from:\n"select place in "Bejing" "shenzhen" "shanghai" "shaoguan" "guangzhou"doprintf "you have select ${place}\n"if [ ${place} = "shaoguan" ];thenprintf "I'm from ${place}\n"breakfidone .........【阅读全文】
发布时间:2018-03-17 09:58:39
用法1:##printf "example 1:\n"for ((i = 0; i < 10; i++))doprintf "${i} "doneprintf "\n\n" 执行结果:example 1:0 1 2 3 4 5 6 7 8 9 用法2:##printf "example 2:\n"for i in $(seq 1 10)doprintf "$i "done.........【阅读全文】
发布时间:2018-03-15 23:28:29
1、二元比较操作符1.1、整数比较-eq 等于 如:if [ “$a” -eq “$b” ]-ne 不等于 如:if [ “$a” -ne “$b” ]-gt 大于 如:if [ “$a” -gt “$b” ]-ge 大于或等于 如:if [ “$a” -ge “$b” ].........【阅读全文】
发布时间:2018-03-12 23:50:10
include指示符告诉make暂停读取当前的makefile,转去读取“include”指定的一个或者多个文件,完成以后再继续当前makefile的读取。 格式Include FILENAMES... 例子:文件makefile: ifdef _ERROR_$(error "find a error!")endif include a.mk b.........【阅读全文】
发布时间:2018-03-11 23:06:10
Make提供了两个控制make运行方式的函数。通常它们用在makefile中,当make执行过程中检测到某些错误是为用户提供消息,并且可以控制make过程是否继续。 $(error TEXT...)提示text消息,同时退出make执行$(warning TEXT...)提示text消息,并且继续执行 例子:$(warning "this is.........【阅读全文】