0
0
Linux CLIscripting~10 mins

export command in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the environment variable MY_VAR to 'hello' using export.

Linux CLI
export MY_VAR=[1]
Drag options to blanks, or click blank then click option'
Ahello
B'hello'
C"hello"
DHELLO
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes can cause errors if the value has spaces or special characters.
Using uppercase without quotes sets a different value.
2fill in blank
medium

Complete the code to export the PATH variable by adding '/usr/local/bin' at the end.

Linux CLI
export PATH=$PATH[1]/usr/local/bin
Drag options to blanks, or click blank then click option'
A:
B;
C,
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon ';' which is for Windows paths.
Using plus '+' or comma ',' which are invalid separators.
3fill in blank
hard

Fix the error in the code to export a variable named DATA_DIR with the value '/data/files'.

Linux CLI
export [1]='/data/files'
Drag options to blanks, or click blank then click option'
Adata_dir
Bdata-dir
CDataDir
DDATA_DIR
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or mixed case variable names.
Using dashes '-' which are invalid in variable names.
4fill in blank
hard

Fill both blanks to export a variable named CONFIG_PATH with the value '/etc/config'.

Linux CLI
export [1]=[2]
Drag options to blanks, or click blank then click option'
ACONFIG_PATH
B'/etc/config'
C"/etc/config"
Dconfig_path
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase variable names.
Not quoting the value.
5fill in blank
hard

Fill all three blanks to export a variable named LIB_PATH by adding '/usr/lib' to the existing LIB_PATH.

Linux CLI
export [1]=$[2]:[3]
Drag options to blanks, or click blank then click option'
ALIB_PATH
C/usr/lib
D/usr/local/lib
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names in export and reference.
Using wrong path or separator.