ref: 6ea764ff9cc93aab462e4a7db6796d149175e5d2 dir: /osdir/
#!/bin/rc rfork ne d=`{pwd} a='' while(! p=`{ns | grep ' /mnt/term/.* '^$"d^'[ ]*$' | sed 's,.*/mnt/term([^ ]*).*,\1,g'}) { a=`{basename $"d}^/^$"a d=`{basename -d $"d} } echo $p/$a