ユーザ用ツール

サイト用ツール


bash:script:02_check_remote_file

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
bash:script:02_check_remote_file [2014/06/05 06:55] matsuibash:script:02_check_remote_file [2015/05/08 06:19] (現在) matsui
行 1: 行 1:
 +====== 02 リモートファイルチェック ======
  
 +<code>
 +chk_remote_file() {
 +    if [ `ssh ${1} test -e ${2} ; echo \$?` != "0" ]; then
 +        return 1
 +    fi
 +    return 0
 +}
 +</code>
 +
 +
 +====== リモートディレクトリチェック ======
 +
 +
 +<code>
 +chk_remote_dir() {
 +    if [ `ssh ${1} test -d ${2} ; echo \$?` != "0" ]; then
 +        return 1
 +    fi
 +    return 0
 +}
 +</code>
 +
 +{{tag>bash}}