facebook twitter hatena line email

「Linux/コマンドメモ/bash」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(ページの作成:「 ==シェルスクリプト実行== スクリプトのあるDirまでcdでいき $ ./xxx.sh とする。 ○シェルは実行権限がいる #!/bin/bash ProcessCount...」)
(相違点なし)

2015年5月20日 (水) 03:17時点における版

シェルスクリプト実行

スクリプトのあるDirまでcdでいき

$ ./xxx.sh

とする。

○シェルは実行権限がいる

#!/bin/bash
ProcessCount=`ps -e|grep -e 'xxx.sh' -c`
if [ $ProcessCount -gt 2 ] ; then
        exit 1
fi
cd /export1/batch/batDir/
/usr/local/bin/php bat1.php
/usr/local/bin/php bat2.php

実行できなければ、bashをつける

bash xxx.sh