[prev] [index] [next]

Shell Version #2

Comments on this implementation:
  • stores suffixes, one per line, in separate files called

    suffix/prefixWord1/prefixWord2
    

  • each suffix file is built by creating empty file and appending suffixes
  • uses `..` and sed to combine suffixes into list of words
  • uses shift to choose a random element from this list
  • could equally well have done something like:
    • use wc to work out how many lines in the file
    • generate a random line number, and extract that line with sed