shell script를 작성할 때, 다음 사진과 같이 비밀번호를 작성해야하는 데, 자동으로 입력하려고 합니다. 방법이 없을까요? ㅍ
yes 패스워드 | shell script 명
here string 이나 here document 를 사용하시면 될 것 같은데요.
입력을 한번만 물어볼 경우, (here string)
[user@host ~]$ ./sh.sh << password
입력을 3번 물어볼 경우 (here document)
[user@host ~]$ ./sh.sh <<<EOL password password password EOL
yes 패스워드 | shell script 명
yes 패스워드 | shell script 명
here string 이나 here document
here string 이나 here document 를 사용하시면 될 것 같은데요.
입력을 한번만 물어볼 경우, (here string)
입력을 3번 물어볼 경우 (here document)