Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
STRING-SUB(1)			  fish-shell			 STRING-SUB(1)

NAME
       string-sub - extract substrings

SYNOPSIS
	  string sub [(-s | --start) START] [(-l | --length) LENGTH] [(-q | --quiet)] [STRING...]

DESCRIPTION
       string sub prints a substring of	each string argument. The start	of the
       substring can be	specified with -s or --start followed by a 1-based in-
       dex  value.  Positive  index  values  are  relative to the start	of the
       string and negative index values	are relative to	the end	of the string.
       The default start value is 1. The length	of the substring can be	speci-
       fied with -l or --length. If the	length is not specified, the substring
       continues  to  the  end	of each	STRING.	Exit status: 0 if at least one
       substring operation was performed, 1 otherwise.

EXAMPLES
	  >_ string sub	--length 2 abcde
	  ab

	  >_ string sub	-s 2 -l	2 abcde
	  bc

	  >_ string sub	--start=-2 abcde
	  de

COPYRIGHT
       2019, fish-shell	developers

3.1				 Mar 02, 2021			 STRING-SUB(1)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=string-sub&sektion=1&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help