In this project, I learned about initialization files, local, global, and reserved variables and special parameters in the Shell. Furthermore, I practiced using expansions, performing arithmetic operations, and utilizing aliases.
Create a script that creates an alias.
- Name: ls
- Value: rm *
Create a script that prints hello user, where user is the current Linux user.
Add /action to the PATH. /action should be the last directory the shell looks into when looking for a program.
Create a script that counts the number of directories in the PATH.
Create a script that lists environment variables.
Create a script that lists all local variables and environment variables, and functions.
Create a script that creates a new local variable.
- Name: BEST
- Value: School
Create a script that creates a new global variable.
- Name: BEST
- Value: School
Write a script that prints the result of the addition of 128 with the value stored in the environment variable TRUEKNOWLEDGE, followed by a new line.
Write a script that prints the result of POWER divided by DIVIDE, followed by a new line.
- POWER and DIVIDE are environment variables
Write a script that displays the result of BREATH to the power LOVE
- BREATH and LOVE are environment variables
- The script should display the result, followed by a new line
Write a script that converts a number from base 2 to base 10.
- The number in base 2 is stored in the environment variable BINARY
- The script should display the number in base 10, followed by a new line
Create a script that prints all possible combinations of two letters, except oo.
- Letters are lower cases, from a to z
- One combination per line
- The output should be alpha ordered, starting with aa
- Do not print oo
- Your script file should contain maximum 64 characters
Write a script that prints a number with two decimal places, followed by a new line.
The number will be stored in the environment variable NUM.
Write a script that converts a number from base 10 to base 16.
- The number in base 10 is stored in the environment variable DECIMAL
- The script should display the number in base 16, followed by a new line
Write a script that encodes and decodes text using the rot13 encryption. Assume ASCII.
Write a script that prints every other line from the input, starting with the first line.
Write a shell script that adds the two numbers stored in the environment variables WATER and STIR and prints the result.
- WATER is in base water
- STIR is in base stir.
- The result should be in base bestchol