diff options
author | rsc <devnull@localhost> | 2005-03-24 05:17:01 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-24 05:17:01 +0000 |
commit | 65fb6fb74cb14afcc8b7040fcc6f253dec622fd0 (patch) | |
tree | 0f494c00efdcf64b1a1ac07008321661ccd1bf31 /src/cmd/netfiles/netfilestat | |
parent | ed8dfe37dbd4470bbb9ce487e78b1d6ae365fb85 (diff) | |
download | plan9port-65fb6fb74cb14afcc8b7040fcc6f253dec622fd0.tar.gz plan9port-65fb6fb74cb14afcc8b7040fcc6f253dec622fd0.tar.bz2 plan9port-65fb6fb74cb14afcc8b7040fcc6f253dec622fd0.zip |
Be a bit more resilient to errors.
Diffstat (limited to 'src/cmd/netfiles/netfilestat')
-rwxr-xr-x | src/cmd/netfiles/netfilestat | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/netfiles/netfilestat b/src/cmd/netfiles/netfilestat index f01c5de6..d27448d7 100755 --- a/src/cmd/netfiles/netfilestat +++ b/src/cmd/netfiles/netfilestat @@ -10,23 +10,23 @@ f=dostat . netfilelib.rc $1 fn dostat { - { - 9 echo -cd $2 - } | mysftp $1 >$t - if(9 test -e $t -a ! -s $t){ + echo cd $2 | runsftp $1 + if(9 test -e $t.sftp -a ! -s $t.sftp){ echo directory exit 0 } - if(9 grep -s 'Can''t change directory|is not a directory' $t){ + if(9 grep -s 'Can''t change directory|is not a directory' $t.sftp){ echo file exit 0 } - if(9 grep -s 'Couldn''t stat remote file|such file' $t){ + if(9 grep -s 'Couldn''t stat remote file|such file' $t.sftp){ echo nonexistent exit 0 } - cat $t >[1=2] - echo unknown error + { + echo unknown error: + sed 's/^/ /' $t.sftp + } >[1=2] exit 0 } |