advanced.1 revision 1.6
11.6Skamil$NetBSD: advanced.1,v 1.6 2017/05/09 23:26:49 kamil Exp $ 21.6Skamil 31.1SbgraysonUsing the file advanced.1.conf, we might obtain the following results: 41.1Sbgrayson 51.1Sbgrayson% mkdir /p 61.1Sbgrayson% mount `pwd`/advanced.1.conf /p 71.1Sbgrayson% cat /p/tcp/localhost/daytime 81.1SbgraysonTue Jul 6 01:09:15 1999 91.1Sbgrayson 101.1Sbgrayson% cat /p/fs//etc/rc # Note the double /, as fs/ is stripped. 111.1Sbgrayson<contents of /etc/rc> 121.1Sbgrayson 131.1Sbgrayson% cat /p/fs/etc/rc # Since the daemon does a chdir to /, we 141.1Sbgrayson # don't really need to specify the extra slash. 151.1Sbgrayson<contents of /etc/rc> 161.1Sbgrayson 171.1Sbgrayson% cat /p/echo/echo/this/message 181.1Sbgraysonecho/this/message 191.1Sbgrayson 201.1Sbgrayson% cat /p/echo/"This has spaces in it, but is protected by quotes" 211.1SbgraysonThis has spaces in it, but is protected by quotes 221.1Sbgrayson 231.1Sbgrayson% cat /p/echo_nostrip/thisthat 241.1Sbgraysonecho_nostrip/thisthat 251.1Sbgrayson 261.1Sbgrayson% cat /p/echo_noslashNoticeNoSlashHere 271.1SbgraysonNoticeNoSlashHere 281.1Sbgrayson 291.1Sbgrayson% cksum /etc/rc 301.1Sbgrayson1896381655 10514 /etc/rc 311.1Sbgrayson 321.1Sbgrayson% cat /etc/rc | gzip > /tmp/rc.gz 331.1Sbgrayson 341.4Sbgrayson% cksum /tmp/rc /p/gzcat//tmp/rc.gz 351.1Sbgrayson1896381655 10514 /tmp/rc 361.1Sbgrayson1896381655 10514 /p/gzcat//tmp/rc.gz 371.1Sbgrayson 381.1Sbgrayson% cat /etc/rc > /p/gzip//tmp/rc.gz.2 391.1Sbgrayson 401.1Sbgrayson% ls -l /tmp/rc.gz* 411.1Sbgrayson-rw-r--r-- 1 root wheel 3751 Jul 6 01:25 /tmp/rc.gz 421.1Sbgrayson-rw-r--r-- 1 root wheel 3751 Jul 6 01:26 /tmp/rc.gz.2 431.1Sbgrayson 441.1Sbgrayson% cat /etc/rc > /p/gzip9//tmp/rc.gz9 451.1Sbgrayson 461.1Sbgrayson% ls -l /tmp/rc.gz9 471.1Sbgrayson-rw-r--r-- 1 root wheel 3748 Jul 6 01:27 /tmp/rc.gz9 481.1Sbgrayson 491.1Sbgrayson% cat /p/gzcat//tmp/rc.gz9 | cksum 501.1Sbgrayson1896381655 10514 511.1Sbgrayson 521.5Ssalo% cat /p/ftp/ftp.NetBSD.org:pub/NetBSD/README 531.1Sbgrayson <contents deleted> 541.1Sbgrayson 551.5Ssalo% cat /p/http://www.NetBSD.org/index.html 561.1Sbgrayson <contents deleted> 571.1Sbgrayson 581.1Sbgrayson# And now for some more creative uses... 591.1Sbgrayson% cd /tmp 601.1Sbgrayson# Both formats of FTP commands work: 611.5Ssalo% cp /p/ftp/ftp.NetBSD.org:pub/NetBSD/NetBSD-current/tar_files/src/bin.tar.gz . 621.1Sbgrayson 631.5Ssalo% cp /p/ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/tar_files/src/sbin.tar.gz . 641.1Sbgrayson 651.1Sbgrayson% tar xzf sbin.tar.gz 661.1Sbgrayson 671.1Sbgrayson# Or, we can be fancier. Tar tries to convert /p/ftp/a:b into a 681.1Sbgrayson# request for file b from host /p/ftp/a, so we need to 691.1Sbgrayson# circumvent that by using cat. 701.5Ssalo% cat /p/gzcat//p/ftp/ftp.NetBSD.org:pub/NetBSD/NetBSD-current/tar_files/src/sbin.tar.gz | tar xf - 711.1Sbgrayson 721.1Sbgrayson# Or, we can bzip all of our man pages and still access them 731.1Sbgrayson# without changing the man program: 741.1Sbgrayson% cd /usr/share/man/man8 751.1Sbgrayson 761.1Sbgrayson% cat mount_portal.8 | bzip2 -9 > mount_portal.8.bz2 771.1Sbgrayson 781.1Sbgrayson% rm mount_portal.8 791.1Sbgrayson 801.1Sbgrayson% ln -s /p/bzcat//usr/share/man/man8/mount_portal.8.bz2 mount_portal.8 811.1Sbgrayson 821.1Sbgrayson% man mount_portal 831.1Sbgrayson <it works!> 841.1Sbgrayson 851.1Sbgrayson% cat /p/nroff//p/bzcat//usr/share/man/man8/mount_portal.bz2 861.1Sbgrayson <also works.> 871.1Sbgrayson 881.1Sbgrayson# Or, rather than putting //, we can use the last nroff 891.1Sbgrayson# configuration, nroff%, instead: 901.1Sbgrayson% cat /p/nroff%/p/bzcat%/usr/share/man/man8/mount_portal.bz2 911.2Sbgrayson 921.2Sbgrayson# Also, we can provide read-only 'sysctlfs' functionality. This 931.2Sbgrayson# is provided by the shell script sysctlfs.sh, which should be in 941.2Sbgrayson# /usr/share/examples/mount_portal. 951.2Sbgrayson 961.2Sbgrayson% cat /p/sysctl/kern.mbuf 971.2Sbgraysonmsize = 128 981.2Sbgraysonmclbytes = 2048 991.2Sbgraysonnmbclusters = 512 1001.2Sbgraysonmblowat = 16 1011.2Sbgraysonmcllowat = 8 1021.2Sbgrayson 1031.2Sbgrayson% cat /p/sysctl/kern/mbuf 1041.2Sbgraysonmsize = 128 1051.2Sbgraysonmclbytes = 2048 1061.2Sbgraysonnmbclusters = 512 1071.2Sbgraysonmblowat = 16 1081.2Sbgraysonmcllowat = 8 1091.2Sbgrayson 1101.2Sbgrayson% cat /p/sysctl/kern/mbuf/msize 1111.2Sbgrayson128 112