I'm supposed to write a bash script that has as an argument a path to a directory which contains a file named checking.txt. It needs to return the following exit codes:

  • 4, if the directory doesn't exist
  • 5, if that directory is not a subdirectory of /home/user5/task05/
  • 6, if checking.txt doesn't exist

How can I write these conditionals ?

  • 5
    This question appears to be off-topic because it is about homework. – slm Nov 23 '13 at 13:40

It looks like a student task therefore I will not provide a solution, but some links that will help you to find it on your own.

And I wish you good luck in finding solution.

Not the answer you're looking for? Browse other questions tagged or ask your own question.