]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/B
g: revert accidental change, document missing file type
[plan9front.git] / rc / bin / B
1 #!/bin/rc
2
3 files=()
4 dest=()
5
6 if(~ $#* 0){
7         echo usage: B file ... >[1=2]
8         exit usage
9 }
10
11 for(i)
12         switch($i){
13         case /*
14                 files = ( $files $i )
15         case *
16                 files = ( $files `{cleanname `{pwd}^/$i} )
17         }
18
19
20 if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){
21         plumb -s B -d edit $files
22         exit
23 }
24
25 # using sam srv file
26
27 if(test -f /mnt/term/srv/sam.$user) dest = /mnt/term/srv/sam.$user
28 if not if(test -f /srv/sam.$user) dest = /srv/sam.$user
29 if not {
30         echo B: can''''t find sam server file >[1=2]
31         exit open
32 }
33
34 switch($files){
35 case *:*
36         for(i in $files)
37                 echo $i | sed 's/^/B /;s/:([0-9]+)$/\n\1/g' >> $dest
38 case *
39         echo B $files >> $dest
40 }