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

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)
  • 방명록

iF (1)
Bash Scripting 07 - if

처음 shell programming 관련 글에서 if 를 만났을 때, 당황스러웠습니다. if 가 사용되는 기본형을 봅시다. if [ expression ] then ... fi 그 글에서 if 와 [ 사이에 공백이 필요하고 [ 와 expression 사이에도 공백이 필요하다고 강조를 하더군요. 공백이 왜 필요하지? if 다음에 ( 가 따라와야 하는 C/C++ 혹은 Java 등과 비교해보면 이상합니다. 그 언어들에서 if 와 ( 사이, ( 와 expression 사이에 공백을 요구하지 않았거든요. 그래서 이유를 알아 보았습니다. 다른 프로그래밍 언어에서는 if 는 뒤에 논리식(logical expression)이 따라 옵니다. 하지만 bash 는 사정이 다릅니다. if command #command 위치..

Programming Language/Shell Programming 2022. 7. 27. 01:04
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • script
  • 다익스트라
  • bash
  • python3
  • stack
  • 세그먼트 트리
  • Vim
  • Aho-Corasick
  • lazy propagation
  • BOJ
  • map
  • C++ big number
  • RUBY
  • Shell Programming
  • math font
  • Reference
  • Dijkstra
  • max flow
  • nearest common ancestor
  • number theory
  • 백준
  • shell
  • persistent segment tree
  • 정수론
  • JavaScript
  • dynamic programming
  • javascript array
  • segment tree
  • fenwick tree
  • bash script
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

티스토리툴바