Back to Fish

string-length - print string lengths¶

docs/docs/3.3/cmds/string-length.html

latest620 B
Original Source

string-length - print string lengths

Synopsis

string length [(-q | --quiet)] [STRING...]

Description

string length reports the length of each string argument in characters. Exit status: 0 if at least one non-empty STRING was given, or 1 otherwise.

Examples

\>\_ string length 'hello, world'12\>\_ set str foo\>\_ string length -q $str; echo $status0
# Equivalent to test -n "$str"