본문 바로가기

script

find PID as process name and send signal using shell script #!/system/bin/shecho "sigquit.system_server.sh: start" > /dev/kmsgecho "sigquit.system_server.sh: start"sleep 10.0str=""echo "sigquit.system_server.sh: delay finish" > /dev/kmsgecho "sigquit.system_server.sh: delay finish"while [ "$str" = "" ]; do str=`ps | grep system_server` sleep 0.1donepid=${str:10:4}echo "sigquit.system_server.sh: kill -3 ${pid}" > /dev/kmsgecho "sigquit.system_server.sh: k.. 더보기
android adb 에서 sh : shell script file 이 실행 안될때 실행법 # sh ./sigquit.system_server.sh & or # /system/bin/sh ./sigquit.system_server.sh & 아래와 같이 error 가 날때는 root@gracelte:/data/local/tmp # sh ./sigquit.system_server.sh & [1] 13625'oot@gracelte:/data/local/tmp # ./sigquit.system_server.sh[3]: sleep: syntax error: Invalid argument '10.0./sigquit.system_server.sh[6]: syntax error: 'while' unmatched [1] + Done (1) sh ./sigquit.system_server.sh Ubunt.. 더보기
linux shell script file 이 실행이 안될때. # ls -al-rwxrwxrwx shell shell 1631963 2014-07-30 21:16 mobibench_arm_3.7.11-rwxrwxrwx shell shell 232 2014-08-26 10:22 msh_dio.sh 모두 권한이 있는데도 불구하고 shell 을 실행하면 permission error 가 발생함. # ./msh_dio.sh1rm failed for /cache/test.db0*, No such file or directory./msh_dio.sh[9]: ./mobibench_arm_3.7.11_dio_0819: can't execute: Permission deniedfailed on '/cache/test.db0' - No such file or directory 정확하.. 더보기
linxu bash shell script 명령어 참고 사이트 : http://cybercafe.tistory.com/330http://linuxconfig.org/bash-scripting-tutorial bash : Bourne-again shell - bash 의 상태 확인# env - shell script 시작파일 첫 머리에 다음 구문 삽입#!/bin/bash - 사칙연산 : leta=10b=10 let c=a+b echo $a+$b=$c --> 출력결과 : 10+10=20 c=$a$b echo $c --> 출력결과 : 1010 a="10"b="10" let c=a+b echo $a+$b=$c --> 출력결과 : 10+10=20 c=$a$b echo $c --> 출력결과 : 1010 - 길이로 문자열 자르기 : ${var:start:length.. 더보기