diff options
author | rsc <devnull@localhost> | 2005-03-18 19:29:47 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-18 19:29:47 +0000 |
commit | 72fd2f881907db5e367ffee1fcecb737c44a0090 (patch) | |
tree | da36e0e4027e4f4f4a9b07c60ba98f8c71b1d987 /bin/netfileget | |
parent | 4c79af3977f1849f246ae2ce347cd7e6376cff5b (diff) | |
download | plan9port-72fd2f881907db5e367ffee1fcecb737c44a0090.tar.gz plan9port-72fd2f881907db5e367ffee1fcecb737c44a0090.tar.bz2 plan9port-72fd2f881907db5e367ffee1fcecb737c44a0090.zip |
will install from src dir
Diffstat (limited to 'bin/netfileget')
-rwxr-xr-x | bin/netfileget | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/bin/netfileget b/bin/netfileget deleted file mode 100755 index c621482d..00000000 --- a/bin/netfileget +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/local/plan9/bin/rc - -f=getfile -if(~ $1 -d){ - f=getdir - shift -} - -if(! ~ $#* 2){ - echo 'usage: netget [-d] system path' >[1=2] - exit usage -} - -ns=`{namespace} -if(u test -S $ns/$1) - f=$f^9p - -t=/tmp/netget.$pid.$USER -fn sigexit { rm -f $t } - -fn getfile { - rm -f $t - if(! echo get $2 $t | sftp -b - $1 >/dev/null) - exit 1 - cat $t -} - -fn getfile9p { - if(! 9p read $1/$2) - exit 1 -} - -fn getdir { - if(! {echo cd $2; echo ls -l} | sftp -b - $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}' -} - -fn getdir9p { - 9p ls -l $1/$2 | awk '{s=$NF; if($0 ~ /^d/) s=s"/"; print s}' -} - -$f $1 $2 -exit 0 - |