I am wanting to check that a certain directories always appear after other directories in an environment variable.List items are separated by a colon, as with the PATH variable.This is not simply for bash, but for a few different shells.The problem is, I'm not sure how to check the order of items in a list using standard unix utilities.What would be a starting point?edit: An example would be$LIST=/test:/bin/test:/etc/test:/nan/:/varI would want to test for example that any directory path that had the word test in it was prior in the list to a directory that did not.What I want to do is small enough that I can hardcode the directories, so a  dynamic solution is not necessary.
Checking the order of items in a shell environment variable
environment variables;utilities;coreutils