手册页部分 1: 用户命令

退出打印视图

更新时间: 2014 年 7 月
 
 

tsort(1)

名称

tsort - topological sort

用法概要

tsort [file]

描述

The tsort command produces on the standard output a totally ordered list of items consistent with a partial ordering of items mentioned in the input file.

The input consists of pairs of items (non-empty strings) separated by blanks. Pairs of different items indicate ordering. Pairs of identical items indicate presence, but not ordering.

操作数

The following operand is supported:

file

A path name of a text file to order. If no file operand is given, the standard input is used.

示例

示例 1 An example of the tsort command

The command:

example% tsort <<EOF
a b c c d e
g g
f g e f
EOF

produces the output:

a
b
c
d
e
f
g

环境变量

See environ(5) for descriptions of the following environment variables that affect the execution of tsort: LANG, LC_ALL , LC_CTYPE, LC_MESSAGES, and NLSPATH.

退出状态

The following exit values are returned:

0

Successful completion.

>0

An error occurred.

属性

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed
Standard

另请参见

lorder(1), attributes(5), environ(5), standards(5)

诊断

Odd data: there are an odd number of fields in the input file.