1
0

window 515 B

1234567891011121314151617181920212223
  1. #!/bin/rc
  2. switch($#*){
  3. case 0 1
  4. echo usage: window '''minx miny maxx maxy''' cmd args ...
  5. exit usage
  6. }
  7. rfork ns
  8. if(mount $wsys /mnt/wsys N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){
  9. shift
  10. bind -b /mnt/wsys /dev
  11. echo -n `{basename $1} > /dev/label >[2] /dev/null
  12. @{
  13. echo hang > /proc/^`{cat /dev/ppid}^/ctl
  14. $* < /dev/cons > /dev/cons >[2] /dev/cons &
  15. exit $apid
  16. }
  17. ostatus = `{echo $status | sed 's/.*://'}
  18. echo waitstop > /proc/$ostatus/ctl
  19. echo nohang > /proc/$ostatus/ctl
  20. exit $ostatus
  21. }
  22. exit 0