티스토리 뷰
반응형
Arithmetic Evaluation Using let
$ x=10
$ x=x+1
$ echo $x
x+1
$ x=10
$ let x=x+1 //let command enables shell scripts to use arithmetic expressions
$ echo $x
11
$ (( x=x+1 ))
$ echo $x
12
$ x=12
$ (( x>10 ))
$ echo $?
0
$ (( x<10 ))
$ echo $?
1
test - arithmetic evaluation, string, file
let - arithmetic evaluation, arithmetic operator
while
ans=yes
while [ "$ans" = yes ]
do
echo Enter a name
read name
echo $name >> file.names
echo "Continue?"
echo enter yes or no
read ans
done
$ vi sum_them
"sum_them" 10 lines, 139 characters
x=1
sum=0
while (( x <= $1 ))
do echo enter $x th num
read num
(( sum = sum + num))
let x=x+1
echo sum is $sum
done
echo total $sum
until
ans=yes
until [ "$ans" = no ]
do
echo Enter a name
read name
echo $name >> file.names
echo "Continue?"
echo enter yes or no
read ans
done
for
반응형
'IoT 과정' 카테고리의 다른 글
POSIX Shell Programming (0) | 2017.07.05 |
---|---|
HPUX - Managing Users and Groups (0) | 2017.06.26 |
HPUX - Shell Programming - Branches (0) | 2017.06.23 |
HPUX - Shell Programming (0) | 2017.06.23 |
HPUX - Process Control (0) | 2017.06.22 |
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- grafana cloud
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- Arena
- 대규모 시스템 설계 기초
- beginning javascript
- paul wilton
- 항해99
- 로젠
- 자바스크립트
- Simulation
- rosen
- 아레나 시뮬레이션
- 데이터 중심 애플리케이션 설계
- 최단경로 알고리즘
- 아레나시뮬레이션
- 아레나
- 그라파나
- 백준
- Propositional and Predicate Logic
- 이산수학
- arena simulation
- 시뮬레이션
- 자바스크립트 예제
- 이산 수학
- flutter
- javascript
- Discrete Mathematics
- Grafana
- 명제논리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함