본문 바로가기

분류 전체보기75

조건식 / 프로그램 인자 - 13주차 - 1 조건식문자열 비교, 정수 비교, 파일 검사(일반 파일, 디렉토리, 읽기가능, 쓰기가능, 실행가능,...), 논리식 구성(and, or, not)조건식 예더보기#!/bin/bashif test "hello" = "Hello"then echo TRUEfi#!/bin/bashif [ "hello" = "hello" ]then echo TRUEfi조건식 사용 시 주의사항[ 와 ] 는 각각 독립된 문자로 인식되야 한다.올바른 예[ a = b ]잘못된 예[a = b] [ 와 a, 그리고 b와 ] 사이에 공백이 필요하다.[ a=b ] =와 a, b 사이에 공백 필요 (연산자와 피연산자 구분 필요)프로그램 인자프로그램이 실행될 때 전달되는 값, 프로그램명 옆에 인자들을 차례대로 적음프로그램명 인자1 인자2 인자3$1,.. 2023. 6. 2.
Loop - 12주차 수업 - 2 (실습 3-2 질문) Loop - whilewhile [expresiion]do statementsdonewhile 예더보기#!/bin/bashCOUNTER=0while [ $COUNTER -lt 10 ] do echo The counter is $COUNTER let COUNTER=COUNTER+1done연관있는 연산자 - Relational Operatorlt less thangtgreater thanleless than to equal togegreater than or equal toeqequal tonenot equal to산술평가 - Arithmetic Evaluationlet산술식의 평가산술평가 - Arithmetic Evalution산술평가 let 예시b=1+1let a=1+1echo $b=$a1+1=2이중 소.. 2023. 6. 1.
Basic Shell Programming - 12주차 - 1 Shell Script 작성 BASH - Bourne Again Shell을 중심으로 작성 간단한 예 #very Simple Shell Script Example echo Hello. # output to display #은 설명문(comment)을 시작하는데 사용. #이후부터 줄 끝까지는 설명문으로 취급된다. #!으로 시작하기 #!/bin/bash echo Hello. #!다음에는 이 script를 해석할 명령어 해석기(command interpreter)를 지정한다. // 첫 줄에서 사용해야 한다. 만일 #!이 첫 줄이 없으면 기본 shell이 해석기로 사용된다. Bourne Shell Script C Shell Script Korn Shell Script #!bin/sh echo Hello. #!/.. 2023. 6. 1.
Internet, Communication - 11주차 수업 - 2 ftp - File Transfer Protocol 네트워크를 통해 다른 컴퓨터와 파일을 주고받기 위해 사용되는 프로토콜,client에서 server로 접속한 후 파일을 받거나(get), 또는 보낸다.(put)clientserverput ->ftp / sftp 클라이언트 프로그램GUI 기반텍스트 기반Filezillasftp(in Windows)MobaXtermsftp(in Unix)Altoolspsftp(in PuTTY)웹 브라우저 - ftp:// ftp 명령어 / sftp 명령어ftp 명령sftp 명령접속파일 받기byelpwdopengetcdlsclosemgetchgrplumaskuser chmodmkdir디렉토리chownprogresscdlsdfputdirpwdpwdquitlcdllsgetrename.. 2023. 5. 31.