Plan 9 from Bell Labs’s /usr/web/sources/contrib/yk/lab/unix9/guide

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Local for(i in pi^(1 2 3 4 5 6 7) trixie) xfs pi@$i
B /n/pi1 /n/pi2 /n/pi3 /n/pi4 /n/pi5 /n/pi6 /n/pi7 /n/trixie

Edit X!Errors! >echo delete > /mnt/acme/$winid/ctl &

Edit X!/n/[^/]+/$! >dircpu &
Edit X!/n/[^/]+/$! >x uptime &
Edit X!/n/[^/]+/$! >x cat /sys/firmware/devicetree/base/model &
Edit X!/n/[^/]+/$! >x vcgencmd get_config total_mem &
Edit X!/n/[^/]+/$! >x ip addr &
Edit X!/n/[^/]+/$! >x df -h / &

Edit X!Errors! >x sudo apt update &
Edit X!Errors! >x sudo apt upgrade -y &

Edit X!/n/[^/]+/$! >x uname -a &
Edit X!Errors! ,g/aarch64/ >echo delete | 9p write acme/$winid/ctl &
Edit X!Errors! ,v/armv6l/ >echo delete | 9p write acme/$winid/ctl &

# echo Edit B /n/*/boot/firmware/cmdline.txt

echo $home/lib/plumbing
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍✃╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍ 
# remote absolute path dir names go to editor
type is text
data matches '(/[.a-zA-Z¡-￿0-9_/+\-]*[a-zA-Z¡-￿0-9_/+\!\-])'
wdir matches '(/n/[^/]+)(/.*)?'
arg isdir	$1/$data
data set	$dir
plumb to edit
plumb client $editor

# remote absolute path file names, possibly tagged by line number, go to editor
type is text
wdir matches '(/n/[^/]+)(/.*)?'
data matches '(/[.a-zA-Z¡-￿0-9_/+\-]*[a-zA-Z¡-￿0-9_/+\!\-])('$addr')?'
attr add	addr=$3
data set	$1
wdir matches '(/n/[^/]+)(/.*)?'
arg isfile	$1/$data
data set	$file
plumb to edit
plumb client $editor

# NOTE: the effect of 'data set' and 'attr add' of a partially matched rule (above) persists through the rest of the rules!
#
# From the plumb(7) manpage:
# "Such rewritings are permanent, so rules that specify them should
# be placed after all pattern-matching rules in the rule set."
#
# yrk: I haven't found a way to avoid that, as I need to capture
# context from both 'data matches' and 'wdir matches' for the 'arg isfile' there.
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍✃╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍ 

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.