Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • Can you move the >>$OUTPUT_FILE to the end of the loop, i.e. done >>$OUTPUT_FILE? Commented Mar 1, 2013 at 12:37
  • maybe you dont have permission on the dir to redirect the file. So you maybe running it as sudo. sudo touch will work. but sudo echo "string" >> log.txt wont work. Can you add the permission in that dir to the question and how you are running the script. Commented Mar 1, 2013 at 12:47
  • Ashwin, even a normal touch is working. Did not need a sudo Commented Mar 1, 2013 at 12:53
  • 1
    From your two recent questions, I'd bet your script has some carriage return characters as if coming from a system where line ending is with CRLF. Try dos2unix or d2u on the files to convert to Unix line ending. See the output of cat -vte on the file to confirm. Commented Mar 1, 2013 at 13:35
  • Stephane, my script does not use any input files. All the values required (IN_REGEX, OUT_REGEX and OUTPUT_FILE) are set in the script itself. There seems to be something that is preventing this script from writing to the filesystem. I have checked the permissions, the space availability and also if touch works. All three don't show any problem. Commented Mar 1, 2013 at 14:41