---
title: "linux 内建指令 let"
author: "413899327"
date: "2010-08-18T17:26:25Z"
tags: []
categories: ["非技术"]
slug: "linux-let"
draft: false
lastmod: "2010-12-12T11:38:57Z"
id: 740362
url: "https://rogerfederer.iteye.com/blog/740362"
---

内建指令 let


linux let命令
let(1) - 計算 (bash shell 內建指令)
語法:
bash
let arg 
說明:
let 是 bash 內建的整數運算。arg 代表運算式。

當得到的值為 0，回應狀態值 1，其他數值，則回應狀態值 0。

實例說明:
來個簡單的(請不要偷笑)

#!/bin/bash
let a=5+4 b=9-3
echo $a $b
 

再來一個

#!/bin/bash 
let "t1 = ((a = 5 + 3, b = 7 - 1, c = 15 - 4))"
echo "t1 = $t1, a = $a, b = $b"
 

好了，寫到此。