TSORT(1) BSD General Commands Manual TSORT(1)NAME
tsort -- topological sort of a directed graph
SYNOPSIS
tsort [-dlq] [file]
DESCRIPTION
The tsort utility takes a list of pairs of node names representing directed arcs in a graph and prints the nodes in topological order on
standard output. Input is taken from the named file, or from standard input if no file is given.
There must be an even number of nodes in the input. Node names specified on the same line should be white space separated.
Presence of a node in a graph can be represented by an arc from the node to itself. This is useful when a node is not connected to any other
nodes.
If the graph contains a cycle (and therefore cannot be properly sorted), one of the arcs in the cycle is ignored and the sort continues.
Cycles are reported on standard error.
The options are as follows:
-d Turn on debugging.
-l Search for and display the longest cycle. Can take a very long time.
-q Do not display informational messages about cycles. This is primarily intended for building libraries, where optimal ordering is not
critical, and cycles occur often.
SEE ALSO ar(1)HISTORY
The tsort command appeared in Version 7 AT&T UNIX. This tsort command and manual page are derived from sources contributed to Berkeley by
Michael Rendell of Memorial University of Newfoundland.
BUGS
The tsort utility does not recognize multibyte characters.
BSD December 27, 2006 BSD
Check Out this Related Man Page
tsort(1) User Commands tsort(1)NAME
tsort - topological sort
SYNOPSIS
/usr/ccs/bin/tsort [file]
DESCRIPTION
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 (nonempty strings) separated by blanks. Pairs of different items indicate ordering. Pairs of identical
items indicate presence, but not ordering.
OPERANDS
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.
EXAMPLES
Example 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
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of tsort: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWbtool |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO lorder(1), attributes(5), environ(5), standards(5)DIAGNOSTICS
Odd data: there are an odd number of fields in the input file.
SunOS 5.10 1 Feb 1995 tsort(1)
Hello,
I have a question:
is there a way to have a "for" cycle done a certain number of times. For example in c++ I can do this:
for (i=o;i<10;i++)
and the cycle will be repeated 10 times.
in UNIX for example I do this:
for i in `cat /etc/host` do done
and the cycle will be repeated... (6 Replies)
This perhaps does not belong in ths category; apologies, however, we have a heated debate going and your input will decide the result.
Should UNIX (HP, AIX, etc) be rebooted following a monthly cycle (Every month, or a qtr, etc.). We have some UX admins (grumps) who say they have seen a UX... (6 Replies)
hi,
this my text
......................
Read 21 physical / 21 logical HMMs
Read lattice with 16 nodes / 36 arcs
Created network with 53 nodes / 73 links
File: speech.mfc
!sil two eight six nine six eight !sil == -68.5133 (Act=50.4)......................
i need to extract output text... (4 Replies)