home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / misc / 22967 < prev    next >
Encoding:
Text File  |  1992-12-12  |  4.3 KB  |  122 lines

  1. Newsgroups: comp.sys.next.misc
  2. Path: sparky!uunet!blaze.cs.jhu.edu!syzygy.cs.jhu.edu!swiet
  3. From: swiet@syzygy.cs.jhu.edu (Alexander Swietlicki)
  4. Subject: Re: Is there a "cut" command available for the NeXT ???
  5. Message-ID: <1992Dec12.171809.26343@blaze.cs.jhu.edu>
  6. Sender: news@blaze.cs.jhu.edu (Usenet news system)
  7. Organization: Johns Hopkins Computer Science Department, Baltimore, MD
  8. References: <1992Dec9.030102.5535@leland.Stanford.EDU> <28333@oasys.dt.navy.mil> <1992Dec11.142738.11686@black.toppoint.de>
  9. Date: Sat, 12 Dec 1992 17:18:09 GMT
  10. Lines: 110
  11.  
  12. .\" Copyright (c) 1989, 1990 The Regents of the University of California.
  13. .\" All rights reserved.
  14. .\"
  15. .\" This code is derived from software contributed to Berkeley by
  16. .\" the Institute of Electrical and Electronics Engineers, Inc.
  17. .\"
  18. .\" Redistribution and use in source and binary forms, with or without
  19. .\" modification, are permitted provided that the following conditions
  20. .\" are met:
  21. .\" 1. Redistributions of source code must retain the above copyright
  22. .\"    notice, this list of conditions and the following disclaimer.
  23. .\" 2. Redistributions in binary form must reproduce the above copyright
  24. .\"    notice, this list of conditions and the following disclaimer in the
  25. .\"    documentation and/or other materials provided with the distribution.
  26. .\" 3. All advertising materials mentioning features or use of this software
  27. .\"    must display the following acknowledgement:
  28. .\"    This product includes software developed by the University of
  29. .\"    California, Berkeley and its contributors.
  30. .\" 4. Neither the name of the University nor the names of its contributors
  31. .\"    may be used to endorse or promote products derived from this software
  32. .\"    without specific prior written permission.
  33. .\"
  34. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  35. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  36. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  37. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  38. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  39. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  40. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  41. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  42. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  43. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  44. .\" SUCH DAMAGE.
  45. .\"
  46. .\"     @(#)cut.1    5.5 (Berkeley) 6/27/91
  47. .\"
  48. .Dd June 27, 1991
  49. .Dt CUT 1
  50. .Os
  51. .Sh NAME
  52. .Nm cut
  53. .Nd select portions of each line of a file
  54. .Sh SYNOPSIS
  55. .Nm cut
  56. .Fl c Ar list
  57. .Ar
  58. .Nm cut
  59. .Fl f Ar list
  60. .Op Fl d Ar string
  61. .Op Fl s
  62. .Ar
  63. .Sh DESCRIPTION
  64. The
  65. .Nm cut
  66. utility selects portions of each line (as specified by
  67. .Ar list  )
  68. from each
  69. .Ar file
  70. (or the standard input by default), and writes them to the
  71. standard output.
  72. The items specified by
  73. .Ar list
  74. can be in terms of column position or in terms of fields delimited
  75. by a special character. Column numbering starts from 1.
  76. .Pp
  77. .Ar List
  78. is a comma or whitespace separated set of increasing numbers and/or
  79. number ranges.
  80. Number ranges consist of a number, a dash
  81. .Pq Li \- ,
  82. and a second number
  83. and select the fields or columns from the first number to the second,
  84. inclusive.
  85. Numbers or number ranges may be preceded by a dash, which selects all
  86. fields or columns from 1 to the first number.
  87. Numbers or number ranges may be followed by a dash, which selects all
  88. fields or columns from the last number to the end of the line.
  89. Numbers and number ranges may be repeated, overlapping, and in any order.
  90. It is not an error to select fields or columns not present in the
  91. input line.
  92. .Pp
  93. The options are as follows:
  94. .Bl -tag -width Fl
  95. .It Fl c Ar list
  96. The
  97. .Ar list
  98. specifies character positions.
  99. .It Fl d Ar string
  100. Use
  101. .Ar char
  102. as the field delimiter character instead of the tab character.
  103. .It Fl f Ar list
  104. The
  105. .Ar list
  106. specifies fields, delimited in the input by a single tab character.
  107. Output fields are separated by a single tab character.
  108. .It Fl s
  109. Suppresses lines with no field delimiter characters.
  110. Unless specified, lines with no delimiters are passed through unmodified.
  111. .El
  112. .Pp
  113. .Nm Cut
  114. exits 0 on success, 1 if an error occurred.
  115. .Sh SEE ALSO
  116. .Xr paste 1
  117. .Sh STANDARDS
  118. The
  119. .Nm cut
  120. utility is expected to conform to
  121. .St -p1003.2 .
  122.