3947840b05
Interpretation of a chunk in cut.1 was helped by: Yoshihiko Sarumaru <mistral@imasy.or.jp>, hrs
237 lines
6.5 KiB
Groff
237 lines
6.5 KiB
Groff
.\" Copyright (c) 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)rs.1 8.2 (Berkeley) 12/30/93
|
|
.\" %FreeBSD: src/usr.bin/rs/rs.1,v 1.11 2004/07/30 00:10:52 tjr Exp %
|
|
.\" $FreeBSD$
|
|
.\"
|
|
.Dd July 30, 2004
|
|
.Dt RS 1
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm rs
|
|
.Nd ¥Ç¡¼¥¿ÇÛÎó¤ÎÀ°·Á
|
|
.Sh ½ñ¼°
|
|
.Nm
|
|
.Oo
|
|
.Fl Oo Cm csCS Oc Ns Op Ar x
|
|
.Oo Cm kKgGw Oc Ns Op Ar N
|
|
.Cm tTeEnyjhHmz
|
|
.Oc
|
|
.Op Ar rows Op Ar cols
|
|
.Sh ²òÀâ
|
|
.Nm
|
|
¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ïɸ½àÆþÎϤòÆɤ߹þ¤ß¡¢
|
|
¤½¤Î³Æ¹Ô¤¬¡¢ÇÛÎó¤ò¶õÇò¤Ç¶èÀڤ俹ԥ٥¯¥È¥ë¤Ç¤¢¤ë¤È¤·¤Æ²ò¼á¤·¡¢
|
|
¤½¤ÎÇÛÎó¤ò¥ª¥×¥·¥ç¥ó¤Ë½¾¤Ã¤ÆÊÑ´¹¤·¡¢
|
|
·ë²Ì¤òɸ½à½ÐÎϤ˽ñ¤½Ð¤·¤Þ¤¹¡£
|
|
°ú¿ô¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢
|
|
.Nm
|
|
¤Ï¡¢Ã¼Ëö¤Ç¸«¤ä¤¹¤¤¤è¤¦¤Ë¡¢ÆþÎϤò¥«¥é¥à·Á¼° (columnar format) ¤ËÊÑ´¹¤·¤Þ¤¹¡£
|
|
.Pp
|
|
ÆþÎÏÇÛÎó¤Î·Á¾õ¤Ï¡¢¤½¤Î¹Ô¿ô¤ÈÂè 1 ¹ÔÌܤΥ«¥é¥à¿ô¤«¤é¿ä¬¤·¤Þ¤¹¡£
|
|
¤½¤ì¤¬ÉÔÅÔ¹ç¤Ê¤é¡¢
|
|
.Fl k
|
|
¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆºÇ½é¤Î¿ô¹Ô¤òÆɤßÈô¤Ð¤·¡¢
|
|
¤è¤ê¹¥ÅÔ¹ç¤Ê¹Ô¤òÍѤ¤¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£
|
|
¤³¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ÆþÎÏ¥«¥é¥à¤Î²ò¼á¤òÊѹ¹¤¹¤ë¤â¤Î¤Ç¤¹¡£
|
|
.Pp
|
|
½ÐÎÏÇÛÎó¤Î·Á¾õ¤Ï°ú¿ô
|
|
.Ar rows
|
|
¤ª¤è¤Ó
|
|
.Ar cols
|
|
¤Î»ØÄê¤Ë¤è¤êÊѲ½¤·¤Þ¤¹¡£¤³¤ì¤é¤Î°ú¿ô¤ÏÀµ¤ÎÀ°¿ô¤Ç¤¹¡£
|
|
¤½¤ì¤é¤Î°ìÊý¤À¤±¤¬Àµ¤ÎÀ°¿ô¤Ç¤¢¤ë¾ì¹ç¡¢
|
|
.Nm
|
|
¤Ï¥Ç¡¼¥¿Á´ÂΤÈÀ°¹ç¤¹¤ë¤â¤¦°ìÊý¤ÎÃͤò·×»»¤·¤Þ¤¹¡£
|
|
ɬÍפʤ顢¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤Ë½Ò¤Ù¤ëÊýË¡¤ÇÉÔ¤·¤¿¥Ç¡¼¥¿¤¬Äɲ䵤졢
|
|
;¾ê¥Ç¡¼¥¿¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
|
|
¹Ô¤ÈÎó¤ÎžÃ֤ʤɡ¢½ÐÎÏ¥«¥é¥à·Á¼°¤òÊѹ¹¤¹¤ë¥ª¥×¥·¥ç¥ó¤â¤¢¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
¥ª¥×¥·¥ç¥ó¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£
|
|
.Bl -tag -width indent
|
|
.It Fl c Ns Ar x
|
|
ÆþÎÏ¥«¥é¥à¤Î¶èÀÚ¤ê¤òñ°ìʸ»ú
|
|
.Ar x
|
|
¤È¤·¤Þ¤¹¡£
|
|
.Ar x
|
|
¤ò¾Êά¤¹¤ë¤È `^I' ¤Ç¤¢¤ë¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£
|
|
.It Fl s Ns Ar x
|
|
.Fl c
|
|
¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢
|
|
.Ar x
|
|
Ãæ¤ÎºÇĹʸ»úÎ󤬶èÀÚ¤ê¤È¤µ¤ì¤Þ¤¹¡£
|
|
.It Fl C Ns Ar x
|
|
½ÐÎÏ¥«¥é¥à¤Î¶èÀÚ¤ê¤òñ°ìʸ»ú
|
|
.Ar x
|
|
¤È¤·¤Þ¤¹¡£
|
|
.Ar x
|
|
¤ò¾Êά¤¹¤ë¤È `^I' ¤Ç¤¢¤ë¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£
|
|
.It Fl S Ns Ar x
|
|
.Fl C
|
|
¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢Ê¸»úÎó
|
|
.Ar x
|
|
¤¬¶èÀÚ¤êʸ»ú¤È¤Ê¤ê¤Þ¤¹¡£
|
|
.It Fl t
|
|
ÆþÎÏÇÛÎó¤ÎÎó¥Ç¡¼¥¿¤òÍѤ¤¤Æ½ÐÎÏÇÛÎó¤Î¹Ô¤òËä¤á¤Þ¤¹¡£
|
|
¤Ä¤Þ¤ê¡¢
|
|
.Ar rows
|
|
¤ª¤è¤Ó
|
|
.Ar cols
|
|
»ØÄê¤òÍ¥À褷¤Ä¤Ä¡¢ÆþÎϤòžÃÖ¤·¤Þ¤¹¡£
|
|
.It Fl T
|
|
.Ar rows
|
|
¤ª¤è¤Ó
|
|
.Ar cols
|
|
»ØÄê¤ò̵»ë¤·¡¢ÆþÎϤνã¿è¤ÊžÃÖ·ë²Ì¤ò½ÐÎϤ·¤Þ¤¹¡£
|
|
.It Fl k Ns Ar N
|
|
ÆþÎϤκǽé¤Î
|
|
.Ar N
|
|
¹Ô¤ò̵»ë¤·¤Þ¤¹¡£
|
|
.It Fl K Ns Ar N
|
|
.Fl k
|
|
¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢Ìµ»ë¤·¤¿³Æ¹Ô¤òɽ¼¨¤·¤Þ¤¹¡£
|
|
.It Fl g Ns Ar N
|
|
¹Â (gutter) ¤ÎÉý (¥«¥é¥à´Ö¤Î¥¹¥Ú¡¼¥¹) ¤ò
|
|
.Ar N
|
|
¤È¤·¤Þ¤¹¡£
|
|
Ä̾ï¤Ï 2 ¤Ç¤¹¡£
|
|
.It Fl G Ns Ar N
|
|
¹Â (gutter) ¤ÎÉý (¥«¥é¥à´Ö¤Î¥¹¥Ú¡¼¥¹) ¤È¤·¤Æ¡¢
|
|
ºÇÂ祫¥é¥àÉý¤Î
|
|
.Ar N
|
|
¥Ñ¡¼¥»¥ó¥ÈÁý¤·¤ÎÃͤòÍѤ¤¤Þ¤¹¡£
|
|
.It Fl e
|
|
ÆþÎϤγƹԤòñ°ì¤ÎÇÛÎ󥨥ó¥È¥ê¤È¤ß¤Ê¤·¤Þ¤¹¡£
|
|
.It Fl n
|
|
Âè 1 ¹ÔÌܤè¤ê¾¯¤Ê¤¤¥¨¥ó¥È¥ê¤·¤«¤Ê¤¤¹Ô¤¬¤¢¤ì¤Ð¡¢
|
|
¤½¤Î¹Ô¤Ë¥Ì¥ë¥¨¥ó¥È¥ê¤òÄɲä·¤ÆËä¤á¹ç¤ï¤»¤Þ¤¹¡£
|
|
Ä̾ï¤Ï¡¢¥¨¥ó¥È¥ê¤ÎÉÔÂʬ¤ÏÆþÎϤμ¡¤Î¹Ô¤«¤é¥¨¥ó¥È¥ê¤ò¤È¤Ã¤ÆËä¤á¹ç¤ï¤»¤Þ¤¹¡£
|
|
.It Fl y
|
|
½ÐÎϤÎÀ£Ë¡¤ò½¼¤¿¤¹¤À¤±¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¾ì¹ç¡¢
|
|
ÆþÎϤòºÇ½é¤«¤é·«¤êÊÖ¤·ÍѤ¤¤Æ½ÐÎϤòËä¤á¹ç¤ï¤»¤Þ¤¹¡£
|
|
Ä̾ï¤Ï¡¢½ÐÎϤ϶õÇò¤ÇËä¤á¹ç¤ï¤µ¤ì¤Þ¤¹¡£
|
|
.It Fl h
|
|
ÆþÎÏÇÛÎó¤Î·Á¾õ¤òɽ¼¨¤¹¤ë¤À¤±¤Ç¡¢½èÍý¤Ï²¿¤â¹Ô¤Ê¤¤¤Þ¤»¤ó¡£
|
|
·Á¾õ¤È¤Ïñ¤Ë¡¢¹Ô¿ô¤È¡¢Âè 1 ¹ÔÌܤΥ¨¥ó¥È¥ê¿ô¤Î¤³¤È¤Ç¤¹¡£
|
|
.It Fl H
|
|
.Fl h
|
|
¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢³Æ¹Ô¤ÎŤµ¤âɽ¼¨¤·¤Þ¤¹¡£
|
|
.It Fl j
|
|
¥«¥é¥àÆâ¤Ç¥¨¥ó¥È¥ê¤ò±¦Â·¤¨¤Ë¤·¤Þ¤¹¡£
|
|
.It Fl w Ns Ar N
|
|
²èÌÌɽ¼¨Éý¤òÀµÀ°¿ô
|
|
.Ar N
|
|
¤ÎÃͤËÀßÄꤷ¤Þ¤¹¡£
|
|
Ä̾ï¤Ï 80 ¤Ç¤¹¡£
|
|
.It Fl m
|
|
½ÐÎÏÇÛÎó¤ÎËöÈø¤«¤é;ʬ¤Ê¶èÀÚ¤êʸ»ú¤òºï½ü¤·¤Þ¤»¤ó¡£
|
|
.It Fl z
|
|
¥«¥é¥àÉý¤òºÇ¤âÂ礤ʥ¨¥ó¥È¥ê¤Ë¤¢¤ï¤»¤Þ¤¹¡£
|
|
.El
|
|
.Pp
|
|
°ú¿ô¤¬¤Ê¤¤¾ì¹ç¡¢
|
|
.Nm
|
|
¤ÏÆþÎϤòžÃÖ¤·¡¢
|
|
̵»ë¤·¤Ê¤¤ºÇ½é¤Î¹Ô¤¬²èÌÌɽ¼¨Éý¤ò±Û¤¨¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
|
|
ÆþÎϤγƹÔËè¤Ë 1 ¤Ä¤ÎÇÛÎ󥨥ó¥È¥ê¤¬¤¢¤ë¤È²¾Äꤷ¤Þ¤¹¡£
|
|
¿ôÃÍ°ú¿ô¤ò¤È¤ë¥ª¥×¥·¥ç¥ó¤Ç¿ôÃÍ»ØÄ꤬¾Êά¤µ¤ì¤Æ¤¤¤ë¤È¡¢
|
|
ÊÌÅӻؼ¨¤¬¤Ê¤¤¸Â¤ê¿ôÃÍ¤Ï 0 ¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£
|
|
.Sh »ÈÍÑÎã
|
|
.Nm
|
|
¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à (Î㤨¤Ð¡¢
|
|
.Xr spell 1 ,
|
|
.Xr du 1 ,
|
|
.Xr file 1 ,
|
|
.Xr look 1 ,
|
|
.Xr nm 1 ,
|
|
.Xr who 1 ,
|
|
.Xr wc 1 )
|
|
¤Î¥¹¥È¥ê¡¼¥à½ÐÎϤò¡¢¹¥ÅÔ¹ç¤Ê¡Ö¥¦¥£¥ó¥É¥¦¡×·Á¼°¤ËÊÑ´¹¤¹¤ë
|
|
¥Õ¥£¥ë¥¿¤È¤·¤ÆÍøÍѤǤ¤Þ¤¹¡£Î㤨¤Ð
|
|
.Bd -literal -offset indent
|
|
who | rs
|
|
.Ed
|
|
.Pp
|
|
¤³¤ì¤ÈƱÍͤʽÐÎϤò¹Ô¤Ê¤¦¤Û¤È¤ó¤É¤Î¥×¥í¥°¥é¥à¤ËÂФ·¤Æ
|
|
.Nm
|
|
¤Ï½½Ê¬¤Êµ¡Ç½¤òÄ󶡤·¤Þ¤¹¤¬¡¢
|
|
.Xr ls 1
|
|
¤Ë¤Ï´û¤Ë¤³¤Îµ¡Ç½¤¬ÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Pp
|
|
¥¹¥È¥ê¡¼¥àÆþÎϤò¥Ù¥¯¥È¥ë¤ËÊÑ´¹¤·¤Æ½ÐÎϤ·¡¢¤½¤ì¤ò¤Þ¤¿¸µ¤ËÌ᤹¤Ë¤Ï¡¢
|
|
¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
|
|
.Bd -literal -offset indent
|
|
rs 1 0 | rs 0 1
|
|
.Ed
|
|
.Pp
|
|
.\" ¡ß¤¬¤¦¤Þ¤¯É½¼¨¤µ¤ì¤Ê¤¤¤Î¤Ç \[mu] »ÈÍÑ
|
|
³ÆÍ×ÁǤ¬ 1 ¤«¤é 100 ¤Þ¤Ç¤ÎÍð¿ô¤«¤éÀ®¤ë 10 \[mu] 10 ¹ÔÎó¤È¤½¤ÎžÃÖ¹ÔÎó¤ò
|
|
À¸À®¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
|
|
.Bd -literal -offset indent
|
|
jot \-r 100 | rs 10 10 | tee array | rs \-T > tarray
|
|
.Ed
|
|
.Pp
|
|
.Xr vi 1
|
|
¥¨¥Ç¥£¥¿¤Ë¤ª¤¤¤Æ¡¢¹Ô¤¢¤¿¤ê 9 Í×ÁǤÎÊ£¿ô¹Ô¥Ù¥¯¥È¥ë¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ
|
|
ÁÞÆþ¤äºï½ü¤ò¹Ô¤Ê¤¤¡¢
|
|
¤½¤Î¸å 9 ¥«¥é¥à·Á¼°¤ËÀ°·Á¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
|
|
.Bd -literal -offset indent
|
|
:1,$!rs 0 9
|
|
.Ed
|
|
.Pp
|
|
ºÇ¸å¤Ë¡¢
|
|
¤¢¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò 4 ¹Ô¤º¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ÎºÇ½é¤Î¹Ô¤Ç¥½¡¼¥È¤·¤¿¤¤¤Ê¤é¡¢
|
|
°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤ß¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£
|
|
.Bd -literal -offset indent
|
|
rs \-eC 0 4 | sort | rs \-c 0 1
|
|
.Ed
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr jot 1 ,
|
|
.Xr pr 1 ,
|
|
.Xr sort 1 ,
|
|
.Xr vi 1
|
|
.Sh ¥Ð¥°
|
|
.Bl -item
|
|
.It
|
|
2 ¼¡¸µÇÛÎó¤·¤«°·¤¨¤Þ¤»¤ó¡£
|
|
.It
|
|
¸½ºß¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¥Õ¥¡¥¤¥ëÁ´ÂΤò¥á¥â¥ê¤ËÆɤ߹þ¤à¤¿¤á¡¢
|
|
¥á¥â¥ê¤ËÆþ¤ê¤¤é¤Ê¤¤¥Õ¥¡¥¤¥ë¤ÏÀ°·Á¤Ç¤¤Þ¤»¤ó¡£
|
|
.It
|
|
ʸ»ú°ÌÃ֤ˤè¤Ã¤Æ¥Õ¥£¡¼¥ë¥É¤òÄêµÁ¤¹¤ë¤³¤È¤Ï¡¢¤Þ¤À¤Ç¤¤Þ¤»¤ó¡£
|
|
.It
|
|
¥«¥é¥à¤òʤٴ¹¤¨¤ë¤³¤È¤â¡¢¤Þ¤ÀÉÔ²Äǽ¤Ç¤¹¡£
|
|
.It
|
|
¥ª¥×¥·¥ç¥ó¤¬Â¿¤¹¤®¤Þ¤¹¡£
|
|
.It
|
|
¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ïǧ¼±¤µ¤ì¤Þ¤»¤ó¡£
|
|
.El
|