shell 을 사용할 때 질문 있습니다.
337
작성한 질문수 3
기본적인 명령어는 잘 되는데요 ls, pwd
따로 미리 설치한 node 나 pm2 등 이런 명령어들은 /bin/sh:
command not found 로 뜨는데 이유를 알 수 있을까요?
답변 3
0
아 그러면 두가지 방법으로 가능할 것 같은데요.
소스코드를 고치거나, 직접 /usr/local/bin을 호출하거나요.
테스트가 필요할꺼 같긴 한데..bashrc에 source를 추가하는 것도 가능할수도 있겠네요.
이 중에 원하시는 해결책이 있을까요?
0
아...어떤 것을 수행했을때는 주시면 좀더 정확하게 답변 드릴수 있을 것 같긴 한데..
command 대신에 shell로 해보시면 어떨까요?
/bin/sh에 있는 것을 읽어들여서 실행하는 건 shell을 통해서 가능해서요.
좀더 궁금하시면 아래의 내용을 읽어보셔도 가능합니다 :)
만약에 shell로 잘 안되면, 실행했던 내용을 주시면 다시 봐드릴께요!!
====== 출처: https://blog.confirm.ch/ansible-modules-shell-vs-command/ ====
Shell vs. Command
A typical example are the Ansible modules Shell and Command. In the most use cases both modules lead to the same goal. Here are the main differences between these modules.
- With the Command module the command will be executed without being proceeded through a shell. As a consequence some variables like $HOME are not available. And also stream operations like <, >, | and & will not work.
- The Shell module runs a command through a shell, by default /bin/sh. This can be changed with the option executable. Piping and redirection are here therefor available.
- The command module is more secure, because it will not be affected by the user’s environment.
강의에 적용한 스크립트를 받아 볼수 있을까요?
0
33
2
수업노트 오타 수정
0
74
1
10051을 열고 10050은 열지 않는 이유가 궁금합니다.
0
105
2
Grafana에서 Loki를 통해 대시보드를 만들 때 어떤 로그를 보는 게 좋은 지 궁금합니다
0
110
1
AWS EC2 OS 설정 관련 문의 드립니다.
0
67
1
git 에 강의내용에 필요한 파일들 존재하지 않음
0
82
2
젠킨스에 등록된..
0
98
2
yml 파일 db 접속정보 수정 후 배포 시 미반영
0
108
2
[해결] install nssm에서 넘어가질 않습니다.
1
77
1
게이트웨이로 핑이 안나가네요
0
1429
1
네트워크 장비에 대한 엔서블 강의도 있나요??
0
248
1
파이썬 실무 프로그래밍 책도 엔서블인가요??
0
271
1
ubuntu 로 실습하면 차이가 클까요?
0
262
1
결과값 오류?
0
470
1
우분투에서 실습 중에 막히는 부분이 있습니다.
0
222
1
ansible-server에서 node 01,02,03 으로 Ping test 실패
0
246
1
playbook을 통한 nginx 구동 실습 중 에러
0
214
1
gateway ping이 실패합니다.
0
1548
3
ping 이 안나가네요
0
942
9
ping을 날릴 때 DUP! 에러가 발생합니다.
0
3918
5
안녕하세요. CentOS다운로드 문의
0
240
1
/etc/ansible/hosts 파일에 2개의 서버를 등록 했는데 1개의 서버만 통신이 됩니다.
0
909
7
가상 머신에서 인터넷 연결이 안됩니다
0
2549
5
state 가 present라는것은 무엇을 의미하는것인지요?
0
800
1





