Branch:
ars
Fenrir ID:ars
Points:25
Your solution must be located at ars:
[folder] ...
├─ [folder] ars
│ ├─ [file code] part-1.sh
│ ├─ [file code] part-2.sh
│ ├─ [file code] part-3.sh
│ └─ [file code] part-4.sh
└─ [folder] .gitCreate a script part-1.sh which assembles files into an archive or compresses them.
- Archivation
-
./part-1.sh -a NAME FILES…— Creates an archiveNAMEwhich contains all the provided files. - Compression
-
./part-1.sh -z DIR FILES…— Compresses each file (gzip format) and puts the result into theDIRdirectory. Add.gzsuffix to the resulting file name.
When running tar xf ARCHIVE, it can automatically infer the compression format itself. Create a script part-2.sh which takes the path to a compressed archive and prints the used algorithm. Use must support these formats: gz, bz2, xz, zst.
Create a script part-3.sh which implements a L command (something like []):
L -e ARCHIVE J # ARCHIVE is empty
L ARCHIVE -sz 7 J # ARCHIVE has exactly 7 files
L ARCHIVE -has FILE J # ARCHIVE contains FILEL and J are equivalents for [ and ]. The command must not print anything to the stdout, however the errors must be logged to the stderr.
The script’s behaviour is expected to be similar to the [: when the condition is true if L .. J; then .. fi must be executed, whereas it is false the if's body must be skipped.
Your script will be installed as L to the PATH during the tests and verified accordingly.
| Code | Description |
|---|---|
33 |
Parsing error |
34 |
The provided archive does not exist |
35 |
The second argument in |
Application for Linux are often distributed as a .tar.gz files. Create a script part-4.sh which takes a path to an archive and installs the application it contains.
Those archives usually follow this structure:
[folder] APPNAME
├─ [folder] bin
│ ├─ [file code] ..
│ └─ [file code] APP
├─ [folder] lib
│ └─ [file code] ..
└─ [folder] ..The APP is the binary which is executed to start the app.
The APPNAME during the tests is always app.
-
The application must be installed to the
/optdirectory -
The script is executed under non-privileged user. His password is pass through the
PASSenv variable -
The script will be
sourced: you may update the env so that the app can be invoked in terminal
The project is licensed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
© 2026-present Iwan Kalinin <koefic.cien@gmail.com>