본문 바로가기
언어/ㄴshell, perl

[shell] shell script, dash -> bash로 환경 바꾸기

by 공대우냉이 2017. 9. 27.

우분투의 기본 쉘은 dash 이다.

$ ls -al /bin/sh

lrwxrwxrwx 1 root root 4  1월 12 15:35 /bin/sh -> dash


하지만, 개발용 shell script들 중 bash 용으로 작성된 것들이 많다.
shell script도 POSIX standard 를 준수하면 좋겠지만,
당장 빌드 에러가 shell script 때문에 발생하고, 개발 진행이 안되면 난감하다.

dash 대신 bash로 기본 쉘을 바꾸자.

$ sudo dpkg-reconfigure dash

No 라고 답변.


아래처럼 바뀐다.

$ ls -al /bin/sh

lrwxrwxrwx 1 root root 4  1월 12 22:48 /bin/sh -> bash


관련 정보는 아래 링크에 있다.

https://wiki.ubuntu.com/DashAsBinSh

======================================================

추가: shell script를 제대로 작성했는데 자꾸 syntax error가 난다면 의심해볼만하다.

dash 환경으로 기본 설정되어 있는 쉘을 bash로 바꿔주자!

======================================================

출처: http://jang574.tistory.com/82 [오모씨의 노트]

'언어 > ㄴshell, perl' 카테고리의 다른 글

[shell] shell 주석달기  (0) 2017.08.01
[perl] perl 관련 명령어  (0) 2017.07.24