Lab: Manage system-wide environment profiles and template user environments

Hello,

Q11: I noticed I cannot use the source command on /etc/environment and as a result echo $LFCS doesn’t work properly. Is this a bug?


sudo vi /etc/environment 
echo $GLOBALENV 
echo $GLOBALOPTION 
echo $LFCS
source /etc/environment

HI @meletiop

Content of /etc/environment has a syntax error.
If you’re trying to set an environment variable to a multiple word value, you must quote the value:

LFCS="Welcome to the KodeKloud LFCS Labs!"

Without the quotes, bash is trying to do a temporary variable assignment with the first word ( LFCS=Welcome ), then treat what follows as a command to execute. There is no command to.

Hello,

I was not aware. It would be helpful to highlight the use of “” in the question description somehow (i.e. Use "Welcome to the KodeKloud LFCS Labs!", instead of Welcome to the KodeKloud LFCS Labs!). Thank you again.

I think the idea is that you should know this. If you decide to do the LFCS exam, it could ask the question in a similar way - to check that you do know this!