본문 바로가기 메뉴 바로가기

MathTrauma

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

MathTrauma

검색하기 폼
  • 분류 전체보기 (128)
    • Mathematics (11)
      • Number Theory (5)
      • Real Analysis - 단편 (4)
      • Latex (1)
      • Inequality (1)
    • DS\Algo (84)
      • Dynamic Programming (16)
      • Tree (5)
      • Segment Tree (11)
      • 최단 경로 (5)
      • Mathematics (5)
      • Binary Search (1)
    • Programming Language (27)
      • Shell Programming (9)
      • Python3 and Ruby (3)
      • JavaScript [초급 -완결] (12)
      • C++ (3)
    • Computer 일반 (6)
      • Blender (1)
      • Jupyter Lab (1)
      • VIM (3)
      • Mac (1)
  • 방명록

bash scripting (1)
Bash Scripting 모르면 곤란한 것들 - if (2)

지난 글의 출발은 짧은 script #!/bin/bash if python3 then echo "hahaha" else echo "..." fi 이었습니다. 이제 if 다음의 python3 가 이상하지 않습니다. 왜냐하면 if 일반적으로 다음에 command 가 따라온다. 을 알기 때문이지요. python3 는 command 이니 문제가 없습니다. ( ls, echo 등등을 python3 위치에 넣고 실행해 보세요!) 그럼 이제 python3 는 참이냐? 거짓이냐? 는 의문을 가질 수 있습니다. But 다른 언어들과는 다르게 shell 에서 if 는 참, 거짓이 아니라 뒤따르는 command 의 exit code 를 바탕으로 분기 합니다. 그리고 command 가 정상 종료했을 때, 즉 exit code..

Programming Language/Shell Programming 2022. 7. 3. 12:13
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 다익스트라
  • JavaScript
  • Shell Programming
  • max flow
  • 정수론
  • nearest common ancestor
  • BOJ
  • Aho-Corasick
  • bash
  • dynamic programming
  • fenwick tree
  • number theory
  • script
  • stack
  • shell
  • 세그먼트 트리
  • math font
  • Vim
  • Dijkstra
  • segment tree
  • map
  • bash script
  • RUBY
  • Reference
  • persistent segment tree
  • 백준
  • lazy propagation
  • C++ big number
  • python3
  • javascript array
more
«   2025/05   »
일 월 화 수 목 금 토
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 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바