Lookup uses 5 streams, 2 input streams and 3 output streams, which can be confusing. We should first describe what lookup does. Lookup first builds a dictionary from a long list of strings (read from FD 3). Once there are no more inputs on FD 3, lookup starts to read from FD 0 (standard input). It then performs a lookup in the dictionary to see if the given string is present. If so, the string is written to FD 1 (stdout). Strings that do not match are written to FD 4. Eventually there will be no more input on FD 0 (end of stdin). At this point, lookup writes all of the entries in the dictionary that were never matched against to FD 5.
It should be noted that any subset of the FDs 1, 4 and 5 can be closed, in which case the corresponding outputs are simply not generated. Here is a simple example for using lookup directly in bash:
echo -e "a\ne\ni\no\nu" > dict.txt
echo -e "a\nb\ne\ne\nf\n" > input.txt
lookup 3< dict.txt aee.txt 4> bf.txt 5> iou.txt
The equivalent use in DUP would be:
look@localhost[0aee.txt,3bf.txt,5>iou.txt] $ lookup ;
Recent comments
9 min 3 sec ago
11 hours 47 min ago
22 hours 30 min ago
22 hours 30 min ago
22 hours 31 min ago
22 hours 33 min ago
1 day 9 hours ago
1 day 9 hours ago
1 day 9 hours ago
1 day 9 hours ago