cut man page on HP-UX

Printed from

cut(1)									cut(1)

       cut - cut out (extract) selected fields of each line of a file

       list [file]...

       list [file]...

       list char] [file]...

       cuts  out (extracts) columns from a table or fields from each line in a
       file; in data base parlance, it implements the projection  of  a	 rela‐
       tion.   Fields  as  specified  by  list can be fixed length (defined in
       terms of character or byte  position  in	 a  line  when	using  the  or
       option),	 or the length can vary from line to line and be marked with a
       field delimiter character such as the tab  character  (when  using  the
       option).	  The input files must be text files, except that line lengths
       are not limited to LINE_MAX characters.	can be used as a filter; if no
       files are given, the standard input is used.

       When processing single-byte character sets, the and options are equiva‐
       lent and produce identical results.  When processing multi-byte charac‐
       ter sets, when the and options are used together, their combined behav‐
       ior is very similar, but not identical to the option.

       Options are interpreted as follows:

	      list	     A comma-separated list of integer	byte  option),
			     character	option),  or field option) numbers, in
			     increasing	 order,	 with  optional	 to   indicate
			     ranges.  For example:

				  Positions 1, 4, and 7.
				  Positions 1 through 3 and 8.
				  Positions 1 through 5 and 10.
				  Position 3 through last position.

	      Cut based on a list of bytes.
			     Each selected byte is output unless the option is
			     also specified.

	      Cut based on character positions specified by
			     list extracts the first  72  characters  of  each

	      Where	     list  is a list of fields assumed to be separated
			     in the file by a  delimiter  character  (see  for
			     example, copies the first and seventh field only.
			     Lines with no field  delimiters  will  be	passed
			     through  intact  (useful  for table subheadings),
			     unless is specified.

	      The character following
			     is the field delimiter option only).  Default  is
			     tab.   Space  or  other  characters  with special
			     meaning to the shell must	be  quoted.   Adjacent
			     field  delimiters	delimit null fields.  char may
			     be an international code set character.

	      Do not split characters.
			     If the high end of a range within a list  is  not
			     the  last	byte of a character, that character is
			     not included in the output.  However, if the  low
			     end  of  a	 range	within a list is not the first
			     byte of a	character,  the	 entire	 character  is
			     included in the output."

	      Suppresses lines with no delimiter characters when using
			     option.   Unless  is  specified,  lines  with  no
			     delimiters appear in the  output  without	alter‐

       Use  to	extract	 text  from  a	file based on text pattern recognition
       (using regular expressions).  Use to merge files line-by-line in colum‐
       nar  format.   To rearrange columns in a table in a different sequence,
       use and See grep(1) and paste(1) for more information.

   Environment Variables
       determines the interpretation of text as single and/or multi-byte char‐

       If  is  not specified in the environment or is set to the empty string,
       the value of is used as a default for each unspecified or  empty	 vari‐
       able.   If is not specified or is set to the empty string, a default of
       "C" (see lang(5)) is used instead of If any internationalization	 vari‐
       able  contains  an invalid setting, behaves as if all internationaliza‐
       tion variables are set to "C".  See environ(5).

   International Code Set Support
       supports both single- and multi-byte  character	code  sets.   Interna‐
       tional  code  set  characters may be specified in the char given to the
       option.	recognizes the international code set characters according  to
       the locale specified in the environment variable.

       Password file mapping of user ID to user names:

       Set environment variable to current login name:

       Convert	file containing lines of arbitrary length into two files where
       contains the first 500 bytes (unless the 500th byte is within a	multi-
       byte character), and contains the remainder of each line:

       Missing	      or  option  or  incorrectly  specified  list.   No error
		      occurs if a line has fewer fields than  the  list	 calls

       list	      is empty.

       does  not expand tabs.  Pipe text through expand(1) if tab expansion is

       Backspace characters are treated the same as any other  character.   To
       eliminate  backspace characters before processing by use the or command
       (see fold(1) and col(1)).

       was developed by OSF and HP.

       grep(1), paste(1).


List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net