From 65fb6fb74cb14afcc8b7040fcc6f253dec622fd0 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 24 Mar 2005 05:17:01 +0000 Subject: Be a bit more resilient to errors. --- src/cmd/netfiles/netfilestat | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cmd/netfiles/netfilestat') 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 } -- cgit v1.2.3