12345678910111213141516171819202122232425 |
- #!/bin/rc
- if(~ $#* 0 1){
- echo 'usage: patch/move dst patch-name...' >[1=2]
- exit usage
- }
- if(! test -d /n/sources/patch){
- rfork n
- 9fs sources
- }
- dst=$1
- shift
- for(i){
- if(! test -d /n/sources/patch/$i)
- echo 'no such patch' /n/sources/patch/$i >[1=2]
- if not if(test -d /n/sources/patch/$dst/$i)
- echo 'already have' /n/sources/patch/$dst/$i >[1=2]
- if not
- ls -ldp /n/sources/patch/$i >/n/sources/patch/$i/origls &&
- mkdir /n/sources/patch/$dst/$i &&
- dircp /n/sources/patch/$i /n/sources/patch/$dst/$i &&
- rm -rf /n/sources/patch/$i
- }
|