DISQUS

Tech-Recipes: Loop over a set of files from the shell | Solaris | Tech-Recipes

  • guest · 5 years ago
    Possibly a bit pedantic, but to save system time (especially if using multiple times in a script) you may be better to do the following for the last part...

    cat `ls -tr *.log` >biglog

    The cat is designed to be able to put two or more files together.

    By doing it this way, you don't need to worry about the existence or contents of biglog as you will overwrite it with the > rather than using apend to >>