In some cases, we may store output from one command in a file, with the intent to use it in the input to another. Consider this script, which accepts a list of ASCII words on its standard input, converts any uppercase letters to lowercase with tr, sorts them, and then prints a count of how often each word is used, sorted by frequency:
#!/bin/bash# Convert all capital letters in the input to lowercase tr A-Z a-z > words.lowercase# Sort all the lowercase words in order sort words.lowercase > words.sorted# Print counts of how many times each word occurs uniq -c words.sorted > words.frequency# Sort that list by frequency, descending sort -k1,1nr words.frequency
This sort of script involving many commands in sequence to filter and ...