Posts
J's Dev Blog
Cancel

constexpr 0. Preface 필자는 constexpr 가 왜 이리도 헷갈리는지 진짜 잠을 설칠 정도였다. 도저히 못참겠어서 이렇게 정리하기로 한다. constexpr는 Modern cpp 인 c++11 이상에서 지원되고 잇다. constexpr의 스펙은 STL 버전이 진화하면서 따라 달라지고 있다고 한다. 다양한 강의자료 및 사용처들을...

CV-qualifiers 0. Preface const 는 Contatnt 즉 상수를 표현하기 위한 기법이고 volatile 은 휘발성(?) 타입이라는 것을 표현하기위한 기법이다. STL에서 cont는 volatile 과 함께 cv qualifiers 로 정의한다. Link: 1. Notation C++ 에서 cv qualifiers 와 같은 ...

set set -e set -e 가 script 내에 실행되어있으면 동작하는 쉘 환경은 script명령어가 error 를 발생하면서 죽었을때 다음 명령을 수행하지 않는다 exit code 일반적으로 unix 에서는 0 은 성공, 1~255 는 error code 로 인식됨 인식되는 범위는 0~255 16bit $? 로 결과값을 확인 가능 $ ...

6. sed sed Utility를 사용안해본사람은 있어도 한번만 사용한 사람은 없다 전해지는 전설의 레전드 Appendix. References General : http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html

Get Ip Address 만약 ethernet interface가 eth0 인 경우 $ IPADDR=$(ifconfig eth0|grep inet|head -1|sed 's/\:/ /'|awk '{print $2}') $ echo $IPADDR 172.17.0.3 Appendix. References General : http://tl...

eval eval 뒤의 string arg 들을 command 로 실행하게 해줌 string 수준에서 최종 Command 조작 후 실행시 유용하다 usages Appendix. References General : http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html

array(list) Bash 에서는 괄호로 Array를 표현가능하다 그 안에서 구분자는 아무래도 띄어쓰기(space bar) 이다 $ cat array_ex.sh #!/bin/bash lists=("a" b "c") echo ${lists[1]} echo ${lists[0]} echo ${lists[3]} echo ${lists[2]} $ sh ...

Bash string comparision using “if” ”==” and “!=” only can be used in case of string comparision. if [ "$STRING" == "abc" ];then echo "STRING is abc!" fi or if [ "$STRING" = "abc" ];then ...

for $ cat for.sh #!/bin/bash LISTS=("a" "b" "c") # Don't forget Brace! echo ${LISTS[0]} echo ${LISTS[1]} echo ${LISTS[2]} # Don't forget Brace! for item in ${LISTS[@]} do echo $item done $...

And $ cat and_or.sh #!/bin/bash test_and_or(){ TEST="11" TEST2="22" if [ "$TEST" == "11" ] && [ "$TEST2" == "22" ] ;then echo "String Exist by And" fi if [ "$...