adds test
This commit is contained in:
parent
a371f5f045
commit
94ef3c6097
|
@ -221,13 +221,13 @@
|
|||
* E) `touch newfile.txt afile.txt`
|
||||
2. You want to copy a directory, `MyFiles`, to a USB flash drive that uses the FAT filesystem. The contents of `MyFiles` are as follows:
|
||||
|
||||
```bash
|
||||
$ ls -l MyFiles/
|
||||
total 276
|
||||
-rw-r--r-- 1 jen users 129840 Nov 8 15:13 contract.odt
|
||||
-rw-r--r-- 1 rod users 42667 Nov 8 15:12 outline.pdf
|
||||
-rw-r--r-- 1 sam users 105979 Nov 8 15:12 Outline.PDF
|
||||
```
|
||||
```bash
|
||||
$ ls -l MyFiles/
|
||||
total 276
|
||||
-rw-r--r-- 1 jen users 129840 Nov 8 15:13 contract.odt
|
||||
-rw-r--r-- 1 rod users 42667 Nov 8 15:12 outline.pdf
|
||||
-rw-r--r-- 1 sam users 105979 Nov 8 15:12 Outline.PDF
|
||||
```
|
||||
|
||||
The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /media/`. What problem will occur when you attempt to copy these files?
|
||||
* A) The command will fail because it tries to create links.
|
||||
|
@ -410,10 +410,10 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
|||
* E) Run a spell checker on the script to ensure it contains no bugs.
|
||||
2. Describe the effect of the following short script, `cp1`, if it's called as `cp1 big.c big.cc`:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
cp $2 $1
|
||||
```
|
||||
```bash
|
||||
#!/bin/bash
|
||||
cp $2 $1
|
||||
```
|
||||
|
||||
* A) It has the same effect as the `cp` command, copying the contents of `big.c` to `big.cc`.
|
||||
* B) It compiles the C program `big.c` and calls the result `big.cc`.
|
||||
|
@ -430,12 +430,12 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
|||
5. True or false: Valid looping statements in Bash include `for`, `while`, and `until`.
|
||||
6. True or false: The following script launches three simultaneous instances of the `terminal` program.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
terminal
|
||||
terminal
|
||||
terminal
|
||||
```
|
||||
```bash
|
||||
#!/bin/bash
|
||||
terminal
|
||||
terminal
|
||||
terminal
|
||||
```
|
||||
|
||||
7. You've written a simple shell script that does nothing but launch programs. In order to ensure that the script works with most user shells, what should its first line read?
|
||||
8. What command can you use to display prompts for a user in a shell script?
|
||||
|
|
Loading…
Reference in New Issue