|
|
@ -7,7 +7,7 @@ Write a command line in a `skip-lines.sh` file that prints the result of a `ls - |
|
|
|
Example: |
|
|
|
Example: |
|
|
|
|
|
|
|
|
|
|
|
```console |
|
|
|
```console |
|
|
|
User-> ls -l |
|
|
|
$ ls -l |
|
|
|
drwxr-xr-x 16 User User 4096 nov 11 10:55 Desktop |
|
|
|
drwxr-xr-x 16 User User 4096 nov 11 10:55 Desktop |
|
|
|
drwxr-xr-x 22 User User 4096 nov 4 10:02 Documents |
|
|
|
drwxr-xr-x 22 User User 4096 nov 4 10:02 Documents |
|
|
|
drwxr-xr-x 6 User User 4096 nov 11 10:40 Downloads |
|
|
|
drwxr-xr-x 6 User User 4096 nov 11 10:40 Downloads |
|
|
@ -24,24 +24,29 @@ drwxr-xr-x 6 User User 4096 nov 11 10:40 Downloads |
|
|
|
drwxr-xr-x 2 User User 4096 set 29 10:34 Pictures |
|
|
|
drwxr-xr-x 2 User User 4096 set 29 10:34 Pictures |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
**Tips:** |
|
|
|
### Hints |
|
|
|
|
|
|
|
|
|
|
|
Here are some Commands that can help you: |
|
|
|
Here are some Commands that can help you: |
|
|
|
|
|
|
|
|
|
|
|
- `sed`. Edit text in a scriptable manner. You can see also: awk. [For more information](https://www.gnu.org/software/sed/manual/sed.html). |
|
|
|
- `sed`. Edit text in a scriptable manner. |
|
|
|
|
|
|
|
|
|
|
|
- Print just a first line to stdout: |
|
|
|
- Print just a first line to stdout: |
|
|
|
`{{command}} | sed -n '1p'` |
|
|
|
`{{command}} | sed -n '1p'` |
|
|
|
|
|
|
|
|
|
|
|
```console |
|
|
|
```console |
|
|
|
User-> cat file |
|
|
|
$ cat file |
|
|
|
AIX |
|
|
|
AIX |
|
|
|
Solaris |
|
|
|
Solaris |
|
|
|
Unix |
|
|
|
Unix |
|
|
|
Linux |
|
|
|
Linux |
|
|
|
HPUX |
|
|
|
HPUX |
|
|
|
User-> sed -n '1p' file |
|
|
|
$ sed -n '1p' file |
|
|
|
AIX |
|
|
|
AIX |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
Use man to see how `awk` or `sed` works, they can do the job. |
|
|
|
> You have to use Man or Google to know more about commands flags, in order to solve this exercise! |
|
|
|
|
|
|
|
> Google and Man will be your friends! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### References |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- [Sed](https://www.gnu.org/software/sed/manual/sed.html). |