Linux/Shell Script

    expect - programmed dialogue with interactive programs

    expect: programmed dialogue with interactive programs 개요Expect는 ' interactive '한 프로그램입니다. ' interactive ' 하다는 단어와 같이 Expect는 Shell 프로그램과 대화하듯 스크립트를 구성할 수 있는 프로그램입니다! Expect를 이용하면 여러 기능들을 굉장히 쉽게 만들 수 있습니다. 여러분들이 작성한 스크립트에 따라 프로그램에서 예상되는 내용에 맞는 답을 작성할 수 있습니다. 여러분들은 프로그램 실행 시 원하는 라인에서 제어권을 갖고 직접 상호 작용할 수도 있습니다. 옵션과 예시를 살펴보면서 좀 더 알아보겠습니다. 설치만약, expect가 설치되어 있지 않다면 아래 명령어로 설치한다.$sudo apt install expe..

    [script] portscan

    https://github.com/linuxias/MyBox/blob/master/script/portscan.sh 12345678910111213141516171819#!/bin/bashIP=127.0.0.1first_port=$1last_port=$2function usage() { echo "Script for scanning port" echo "Usage : ./portscan start_port end_port" echo "Example : ./portscan 1 100" exit}if [ $# -ne 2 ]then usagefifor port in `seq $first_port $last_port`do (echo >/dev/tcp/$IP/$port)> /dev/null 2>&1 && echo..

    [참고용] test 명령어 표현식

    ( EXPRESSION )EXPRESSION is true! EXPRESSIONEXPRESSION is falseEXPRESSION1 -a EXPRESSION2both EXPRESSION1 and EXPRESSION2 are trueEXPRESSION1 -o EXPRESSION2either EXPRESSION1 or EXPRESSION2 is true-n STRINGthe length of STRING is nonzeroSTRINGequivalent to -n STRING-z STRINGthe length of STRING is zeroSTRING1 = STRING2the strings are equalSTRING1 != STRING2the strings are not equalINTEGER1 -eq I..