shell script

    [Linux] shell script programming 2

    13. shell script programming 2shell script programming 1 게시글에 이어서 진행합니다. 13.2 실습예제 13.2.9 and, or 연산자 and 연산자if [ A ] && [ B ]if [ A && B ] → errorif [ A ] -a [ B ] or 연산자if [ A ] || [ B ]if [ A ] -o [ B ] 공백에 주의해서 작성해야 함, if[A] → error -s : 크기가 0이 아니면 then : 다음 라인에 작성하거나 ; 뒤에 작성 gedit andor.sh #!/bin/shecho "input file name:"read fnameif [ -f $fname ] && [ -s $fname ] ; then head -5 $fnameelsee..

    [Linux] shell script programming 1

    13. shell script programming 1본 포스팅은 2부작으로 내용이 구성되어 있습니다. 13.1 Shell Script 13.1.1 shell사용자와 시스템 간의 대화형 프로그램bash - Bourne-again shell(본 어게인 쉘, Bourne shell을 좀더 발전시킨 shell) 13.1.2 shell scriptshell에서 실행되도록 작성된 프로그램컴파일 단계가 없으므로 터미널에서 빠른 실행이 가능함복잡한 쉘 스크립트는 각 명령어의 하위 프로세스에 따라 속도가 느려질 수 있음.shell script의 확장자는 sh로 작성(shell의 약자)윈도우즈의 bat 파일(일괄실행파일)과 비슷한 역할을 함 13.2 실습예제 13.2.1 기본 문법gedit name.sh # 주석(/bi..