Shell setup

This is a README.adoc file. The original repository is located here.

Shell setup

Fenrir ID: shell-setup
Branch: shell-setup
Points: 20

Task description

You have to create a file setup.shell which configures the bash startup process. The setup script will be executed under a non-sudo user.

We recommend using fenrir env when solving this task.

The project structure:

 ...
├─  shell-setup
│  ├─ ..
│  └─  setup.shell
└─  .git

Aliases (5 points)

Since rm command cannot be undone, we want to replace it with a more error-tolerant command. When executing rm FILE, the file must be moved to the /tmp/trash directory. Thus, it can be restored when someone has done something wrong.

You don’t have to support all `rm’s flags.

Autocomplete (10 points)

Set up bash autocomplete for the cow command:

cow say [-a|--aggressive] hi|bye
cow run <DIR>
cow eat <FILE>
cow sleep

You must use complete -F _cow cow command when registering the autocomplete algorithm.

Install software (5 points)

Assume you have already installed cow utility into the /opt/cow folder. However, its execution fails with an error bash: cow: command not found…​: fix it. Moreover, the command expects an environment variable MILKA_TYPE to be LU.

Questions

  • What happens with aliases during non-interactive shell sessions?

  • How does bash resolve commands?

  • What is the difference between .bashrc and .bash_profile files?

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>