On Wed, Jun 17, 2026, at 4:12 PM, Ethan Azariah wrote:
>
> i think i've found it. this is the first line of /data/vm/9/plan9port/bin/man:
> #!/usr/local/plan9/bin/rc
>
> the path mismatch is obvious. :) install(1) claims INSTALL will fix
> paths, [snip]
>
> it looks like INSTALL doesn't fix any of the script paths. i've still
> got my old `fix-rc-scripts` script which can auto-fix rc and awk #!
> lines. i'll run that later.
here's fix-rc-scripts. it gets a bit spammy given a deep tree, but that first echo can be removed to fix that. the echo is useful when you run it from somewhere other than a built p9p install.
% cat fix-rc-scripts
#!/usr/bin/env rc
rfork e
# Fix rc shell scripts to find rc without launching env every time.
# Invoke with rc and plan9 versions of grep and ed in $PATH
# Under Plan 9, source this in a subshell: @{. fix-rc-scripts}
# (it's not a disaster if you omit the subshell,
# it will just make 2 unnecessary environment variables.)
# changelog:
# * fixes awk scripts too
# * no longer requires which
# * fixed to source itself rather than run, and to rfork e
rc=() awk=()
rc=`{whatis rc}
firstline='#!'$"rc
awk=`{whatis awk}
firstline_awk='#!'$"awk' -f'
echo $firstline $firstline_awk
if(~ $#* 0) files = *
if not files = $*
myname = `{basename $0}
for(file in $files) {
if(test -d $file)
@{. $0 $file/*}
if not if(~ $file *$myname)
{}
if not if(sed 1q $file | grep '^#!/.*[/ ]rc$' > /dev/null) {
{
echo 1c
echo $firstline
echo .
echo wq
} | ed $file > /dev/null
}
if not if(sed 1q $file | grep '^#!/.*[/ ]awk[ ]+-f$' > /dev/null) {
{
echo 1c
echo $firstline_awk
echo .
echo wq
} | ed $file > /dev/null
}
}