Linux-공통/Linux-공통__shell-script 8

pid 찾고 할일하기

ps -eaf | grep uwsgi #uwsgi 목록 확인 #root 12345 1 0 Jun26 00:00:00 uwsgi #root 19019 12345 0 Jun26 00:00:00 uwsgi #pid 목록 일단 뽑음 get_pid=$(ps -eaf | grep uwsgi | grep -v grep | awk '{print $2}') #echo ${get_pid} 해서 확인해보면 12345 19019 뭐 이렇게 나와있을 것이다.. #내 경우에는 두번째줄 맨 위에 값만 필요했기 때문에 공백으로 스플릿 해서 리스트에 넣는다 filter_pid='' read -ra pids