#!/bin/sh

sum() {
  x=`expr $1 + $2`
  echo $x
}

sum 4 7
echo “The sum of 4 and 7 is `sum 4 7`”

 

http://www.tech-recipes.com/bourne_shell_scripting_tips541.html

 

創作者介紹
創作者 牛大叔.生活隨筆 的頭像
igogo

牛大叔.生活隨筆

igogo 發表在 痞客邦 留言(0) 人氣( 1523 )