in reply to Re: Removing files with extentions of log and date-time.
in thread Removing files with extentions of log and date-time.

We have a slight misunderstanding. I was speaking of the carets in the three regular expressions a little further down. The regular expressions that you use to select which files to delete. They need to be written without the caret as the text that you want to match is not at the start of the line.

In the grep statement you do need the caret. You need it because you want to exclude files that start with a fullstop (you probably call it a period). So, in the case of the grep you want to match:

  1. Start of line
  2. Followed by a fullstop
  3. Followed by anything at all

This is different from later on when you want to match:

  1. Anything at all. It might be start of line, it might not.
  2. Followed by a fullstop. This might be just after the start of line. Then again, it might be a few characters further along the string being matched against.
  3. Followed by the letter l, then the letter o, then the letter g.

Do you see the difference ?

  • Comment on (Dermot) RE: Re: Removing files with extentions of log and date-time.