for my bash programming assignment i have to create pipelines to process a file to find some patterns. I am currently using the Windows 10 Ubuntu App terminal. I Wrote the following the following :
echo "Processing Log Files..." # error is the word I'm looking for in the files grep error -A 1 logfile1.txt >> filter.txt grep error -A 1 logfile2.txt >> filter.txt echo "Done."
But when i run the file with the header #!/bin/sh I get this error:
Processing Log Files... : Directory nonexistentoder.sh: cannot create filter.txt : Directory nonexistentoder.sh: cannot create filter.txt Done.
And when i run the code with the header #!/bin/bash i get this error:
Processing Log Files... : No such file or directoryer.txt : No such file or directoryer.txt Done.
I honestly have no idea of why this happens, i changed the permissions of the files to the following:
drwxrwxrwx 0 root root 512 Mar 20 23:25 . drwxrwxrwx 0 root root 512 Mar 20 13:59 .. -rwxrwxrwx 1 root root 316 Mar 20 23:24 decoder.sh -rwxrwxrwx 1 root root 52247 Mar 19 15:59 logfile1.txt -rwxrwxrwx 1 root root 33142 Mar 19 15:59 logfile2.txt -rwxrwxrwx 1 root root 239 Mar 19 15:39 mapping-sorted.txt