Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Linux
- SSH
- label
- 오류
- windows forms
- pandas
- Docker
- paramiko
- 기타 연주
- OpenCV
- 명령어
- Visual Studio
- pytorch
- 핑거스타일
- VS Code
- C
- ubuntu
- mysql
- Python
- 프로그래머스
- LIST
- JSON
- YOLO
- error
- Selenium
- C++
- 채보
- 기타
- Numpy
- C#
Archives
- Today
- Total
목록Shell Script (1)
기계는 거짓말하지 않는다
Bash Shell Script 실행 중 에러 자동 처리
Linux Bash Shell Script를 작성하고 실행 도중 오류가 나면 다음 명령어를 중지하고 싶을 때, 아래와 같이 작성할 수 있다. #! /bin/bash # set -e 추가 set -e echo "Hello" # Exception 발생하는 C 프로그램 ./hello # 없는 디렉터리 mkdir mkdir aaa/aaaaa echo "Bash Shell Finished" set -e 명령어를 사용하면 명령 실행 도중 오류 시, 스크립트는 중지된다. 반대로 set +e 명령어를 사용하면 오류가 나더라도 그대로 진행한다. 아래는 예시 결과이다. hello.c 코드 #include int main(void) { printf("hello world\n"); int i = 1; i /= 0; retur..
Linux
2023. 4. 29. 14:53