mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
653 B
26 lines
653 B
6 years ago
|
## Display File
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
|
Write a program that displays, on the standard output, only the content of the file given as argument.
|
||
|
|
||
|
- Create a file `quest8.txt` and write into the file `Almost there!!`
|
||
|
|
||
|
- The argument of the program should be the name of the file, in this case, `quest8.txt`.
|
||
|
|
||
|
- In case of error it should print:
|
||
6 years ago
|
- `File name missing`.
|
||
|
- `Too many arguments`.
|
||
6 years ago
|
|
||
6 years ago
|
### Output:
|
||
6 years ago
|
|
||
|
```console
|
||
|
student@ubuntu:~/student/test$ go build
|
||
|
student@ubuntu:~/student/test$ ./test
|
||
|
File name missing
|
||
|
student@ubuntu:~/student/test$ ./test quest8.txt main.go
|
||
|
Too many arguments
|
||
|
student@ubuntu:~/student/test$ ./test quest8.txt
|
||
|
Almost there!!
|
||
|
```
|