Shall高级编程

源代码在线查看: wh-loopc.sh

软件大小: 1353 K
上传用户: stuoju
关键词: Shall 高级编程
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/bin/bash				# wh-loopc.sh: Count to 10 in a "while" loop.								LIMIT=10				a=1								while [ "$a" -le $LIMIT ]				do				  echo -n "$a "				  let "a+=1"				done           # No surprises, so far.								echo; echo								# +=================================================================+								# Now, repeat with C-like syntax.								((a = 1))      # a=1				# Double parentheses permit space when setting a variable, as in C.								while (( a 				do				  echo -n "$a "				  ((a += 1))   # let "a+=1"				  # Yes, indeed.				  # Double parentheses permit incrementing a variable with C-like syntax.				done								echo								# C programmers can feel right at home in Bash.								exit 0							

相关资源