|
|
|
@ -2,18 +2,10 @@
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
Write a program called `ztail` that has the same behaviour as the system command `tail`, but which takes at least one file as argument. |
|
|
|
|
Write a program that behaves like a simplified `tail` command but which takes at least one file as argument. |
|
|
|
|
|
|
|
|
|
- The only option to be handled is `-c`. This option will be used in all tests. |
|
|
|
|
- The only option to be handled is `-c`. This option will be used in all the tests as the first argument, with positive values. |
|
|
|
|
|
|
|
|
|
- For this program the "os" package can be used. |
|
|
|
|
- For this program the `os` package can be used. |
|
|
|
|
|
|
|
|
|
- For the program to pass the tests the convention for the return code of program in Unix systems should be followed. |
|
|
|
|
|
|
|
|
|
- Handle the errors and output the same error messages as `tail`. |
|
|
|
|
|
|
|
|
|
- For more information consult the man page for `tail`. |
|
|
|
|
|
|
|
|
|
### Note: |
|
|
|
|
|
|
|
|
|
This program is gonna be tested against `tail`, be sure to check all the different error messages with different permutations of the arguments. |
|
|
|
|
- Handle the errors by returning a non-zero exit status. |
|
|
|
|