diff options
author | rsc <devnull@localhost> | 2005-03-21 07:37:34 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-21 07:37:34 +0000 |
commit | b8c9f31785f3243a52432023d4d555d490963769 (patch) | |
tree | 4a55c22d8af3e61f4aa4528c4aefb03fd684769c /src/cmd/netfiles/netfileget | |
parent | e96129189712a83de71d45cbc852a54c5960d575 (diff) | |
download | plan9port-b8c9f31785f3243a52432023d4d555d490963769.tar.gz plan9port-b8c9f31785f3243a52432023d4d555d490963769.tar.bz2 plan9port-b8c9f31785f3243a52432023d4d555d490963769.zip |
new
Diffstat (limited to 'src/cmd/netfiles/netfileget')
-rwxr-xr-x | src/cmd/netfiles/netfileget | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/netfiles/netfileget b/src/cmd/netfiles/netfileget index 88544f5c..ad2d6265 100755 --- a/src/cmd/netfiles/netfileget +++ b/src/cmd/netfiles/netfileget @@ -11,17 +11,17 @@ if(! ~ $#* 2){ exit usage } -ns=`{namespace} -if(u test -S $ns/$1) - f=$f^9p - -t=/tmp/netget.$pid.$USER -fn sigexit { rm -f $t } +. netfilelib.rc $1 fn getfile { rm -f $t - if(! echo get $2 $t | sftp -b /dev/stdin $1 >/dev/null) + if(! 9 echo -get $2 $t | mysftp $1 >$t.e >[2=1]) + exit 1 + egrep -v '^Fetching' $t.e >$t.e2 + if(test -s $t.e2){ + cat $t.e >[1=2] exit 1 + } cat $t } @@ -31,7 +31,7 @@ fn getfile9p { } fn getdir { - if(! {echo cd $2; echo ls -l} | sftp -b /dev/stdin $1 | sed '1,2d; s/sftp> //g; /^$/d' >$t) + if(! {echo cd $2; echo ls -l} | mysftp $1 | sed '1,2d; s/sftp> //g; /^$/d' >$t) exit 1 cat $t | awk '$NF == "." || $NF == ".." { next } {s = $NF; if($0 ~ /^d/) s = s "/"; print s}' } |