Introduction
You've just joined a new software development team at TechCorp. The team uses a specific development environment setup, and you need to configure your system accordingly. This challenge will test your ability to work with environment variables in Linux, a crucial skill for any developer or system administrator.
TechCorp Development Environment
TechCorp uses a custom script called devtool for their development workflow. This tool needs to be accessible from anywhere in the system. Additionally, the team uses a specific configuration file that needs to be referenced by an environment variable.
Tasks
- Create a directory named
techcorp_toolsin your home directory. - Create a simple bash script named
devtoolin thetechcorp_toolsdirectory that prints "TechCorp DevTool v1.0" when executed. - Make the
devtoolscript executable. - Add the
techcorp_toolsdirectory to your PATH so thatdevtoolcan be run from anywhere. Immediately apply this change to your current session. - Append the export command to
.zshrcto set up this environment variable permanently. - Create a file named
techcorp_config.jsonin your home directory with the content:{"env": "development"}. - Create an environment variable named
TECHCORP_CONFIGthat points to the full path of thetechcorp_config.jsonfile. - Make sure the
TECHCORP_CONFIGenvironment variable is available in all new shell sessions.
Hints
- Remember to use
exportwhen setting environment variables. - Don't forget to make your script executable with
chmod. - Use
$HOMEor~to refer to your home directory when setting paths. source ~/.zshrcreloads the.zshrcfile.
Example
After completing the tasks, you should be able to run the following commands from any directory:
$ devtool
TechCorp DevTool v1.0
$ echo $TECHCORP_CONFIG
/home/labex/techcorp_config.json
Summary
Congratulations! You've successfully configured your development environment according to TechCorp's specifications. You've demonstrated your ability to:
- Create and modify directories and files
- Write and make executable a simple bash script
- Modify the PATH environment variable
- Create custom environment variables
- Make environment changes permanent
These skills are crucial for setting up and maintaining development environments, and will serve you well in your role at TechCorp and in your future career as a developer or system administrator.



