1*909ff0abSkamil$NetBSD: advanced.1,v 1.6 2017/05/09 23:26:49 kamil Exp $
2*909ff0abSkamil
3854e99c5SbgraysonUsing the file advanced.1.conf, we might obtain the following results:
4854e99c5Sbgrayson
5854e99c5Sbgrayson% mkdir /p
6854e99c5Sbgrayson% mount `pwd`/advanced.1.conf /p
7854e99c5Sbgrayson% cat /p/tcp/localhost/daytime
8854e99c5SbgraysonTue Jul  6 01:09:15 1999
9854e99c5Sbgrayson
10854e99c5Sbgrayson% cat /p/fs//etc/rc	# Note the double /, as fs/ is stripped.
11854e99c5Sbgrayson<contents of /etc/rc>
12854e99c5Sbgrayson
13854e99c5Sbgrayson% cat /p/fs/etc/rc	# Since the daemon does a chdir to /, we
14854e99c5Sbgrayson			# don't really need to specify the extra slash.
15854e99c5Sbgrayson<contents of /etc/rc>
16854e99c5Sbgrayson
17854e99c5Sbgrayson% cat /p/echo/echo/this/message
18854e99c5Sbgraysonecho/this/message
19854e99c5Sbgrayson
20854e99c5Sbgrayson% cat /p/echo/"This has spaces in it, but is protected by quotes"
21854e99c5SbgraysonThis has spaces in it, but is protected by quotes
22854e99c5Sbgrayson
23854e99c5Sbgrayson% cat /p/echo_nostrip/thisthat
24854e99c5Sbgraysonecho_nostrip/thisthat
25854e99c5Sbgrayson
26854e99c5Sbgrayson% cat /p/echo_noslashNoticeNoSlashHere
27854e99c5SbgraysonNoticeNoSlashHere
28854e99c5Sbgrayson
29854e99c5Sbgrayson% cksum /etc/rc
30854e99c5Sbgrayson1896381655 10514 /etc/rc
31854e99c5Sbgrayson
32854e99c5Sbgrayson% cat /etc/rc | gzip > /tmp/rc.gz
33854e99c5Sbgrayson
3460174aaaSbgrayson% cksum /tmp/rc /p/gzcat//tmp/rc.gz
35854e99c5Sbgrayson1896381655 10514 /tmp/rc
36854e99c5Sbgrayson1896381655 10514 /p/gzcat//tmp/rc.gz
37854e99c5Sbgrayson
38854e99c5Sbgrayson% cat /etc/rc > /p/gzip//tmp/rc.gz.2
39854e99c5Sbgrayson
40854e99c5Sbgrayson% ls -l /tmp/rc.gz*
41854e99c5Sbgrayson-rw-r--r--  1 root  wheel  3751 Jul  6 01:25 /tmp/rc.gz
42854e99c5Sbgrayson-rw-r--r--  1 root  wheel  3751 Jul  6 01:26 /tmp/rc.gz.2
43854e99c5Sbgrayson
44854e99c5Sbgrayson% cat /etc/rc > /p/gzip9//tmp/rc.gz9
45854e99c5Sbgrayson
46854e99c5Sbgrayson% ls -l /tmp/rc.gz9
47854e99c5Sbgrayson-rw-r--r--  1 root  wheel  3748 Jul  6 01:27 /tmp/rc.gz9
48854e99c5Sbgrayson
49854e99c5Sbgrayson% cat /p/gzcat//tmp/rc.gz9 | cksum
50854e99c5Sbgrayson1896381655 10514
51854e99c5Sbgrayson
52b75abedaSsalo% cat /p/ftp/ftp.NetBSD.org:pub/NetBSD/README
53854e99c5Sbgrayson  <contents deleted>
54854e99c5Sbgrayson
55b75abedaSsalo% cat /p/http://www.NetBSD.org/index.html
56854e99c5Sbgrayson  <contents deleted>
57854e99c5Sbgrayson
58854e99c5Sbgrayson# And now for some more creative uses...
59854e99c5Sbgrayson% cd /tmp
60854e99c5Sbgrayson# Both formats of FTP commands work:
61b75abedaSsalo% cp /p/ftp/ftp.NetBSD.org:pub/NetBSD/NetBSD-current/tar_files/src/bin.tar.gz .
62854e99c5Sbgrayson
63b75abedaSsalo% cp /p/ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/tar_files/src/sbin.tar.gz .
64854e99c5Sbgrayson
65854e99c5Sbgrayson% tar xzf sbin.tar.gz
66854e99c5Sbgrayson
67854e99c5Sbgrayson# Or, we can be fancier.  Tar tries to convert /p/ftp/a:b into a
68854e99c5Sbgrayson# request for file b from host /p/ftp/a, so we need to
69854e99c5Sbgrayson# circumvent that by using cat.
70b75abedaSsalo% cat /p/gzcat//p/ftp/ftp.NetBSD.org:pub/NetBSD/NetBSD-current/tar_files/src/sbin.tar.gz | tar xf -
71854e99c5Sbgrayson
72854e99c5Sbgrayson# Or, we can bzip all of our man pages and still access them
73854e99c5Sbgrayson# without changing the man program:
74854e99c5Sbgrayson% cd /usr/share/man/man8
75854e99c5Sbgrayson
76854e99c5Sbgrayson% cat mount_portal.8 | bzip2 -9 > mount_portal.8.bz2
77854e99c5Sbgrayson
78854e99c5Sbgrayson% rm mount_portal.8
79854e99c5Sbgrayson
80854e99c5Sbgrayson% ln -s /p/bzcat//usr/share/man/man8/mount_portal.8.bz2 mount_portal.8
81854e99c5Sbgrayson
82854e99c5Sbgrayson% man mount_portal
83854e99c5Sbgrayson  <it works!>
84854e99c5Sbgrayson
85854e99c5Sbgrayson% cat /p/nroff//p/bzcat//usr/share/man/man8/mount_portal.bz2
86854e99c5Sbgrayson  <also works.>
87854e99c5Sbgrayson
88854e99c5Sbgrayson# Or, rather than putting //, we can use the last nroff
89854e99c5Sbgrayson# configuration, nroff%, instead:
90854e99c5Sbgrayson% cat /p/nroff%/p/bzcat%/usr/share/man/man8/mount_portal.bz2
912a09ca64Sbgrayson
922a09ca64Sbgrayson# Also, we can provide read-only 'sysctlfs' functionality.  This
932a09ca64Sbgrayson# is provided by the shell script sysctlfs.sh, which should be in
942a09ca64Sbgrayson# /usr/share/examples/mount_portal.
952a09ca64Sbgrayson
962a09ca64Sbgrayson% cat /p/sysctl/kern.mbuf
972a09ca64Sbgraysonmsize = 128
982a09ca64Sbgraysonmclbytes = 2048
992a09ca64Sbgraysonnmbclusters = 512
1002a09ca64Sbgraysonmblowat = 16
1012a09ca64Sbgraysonmcllowat = 8
1022a09ca64Sbgrayson
1032a09ca64Sbgrayson% cat /p/sysctl/kern/mbuf
1042a09ca64Sbgraysonmsize = 128
1052a09ca64Sbgraysonmclbytes = 2048
1062a09ca64Sbgraysonnmbclusters = 512
1072a09ca64Sbgraysonmblowat = 16
1082a09ca64Sbgraysonmcllowat = 8
1092a09ca64Sbgrayson
1102a09ca64Sbgrayson% cat /p/sysctl/kern/mbuf/msize
1112a09ca64Sbgrayson128
112