Complete the code to display the current PATH variable.
echo $[1]The PATH variable holds directories where the system looks for executables. Using echo $PATH shows its current value.
Complete the code to add the directory /usr/local/bin to the PATH variable temporarily.
export PATH=[1]:/usr/local/binTo add a directory to PATH, prepend or append it to the existing $PATH variable using export PATH=$PATH:/new/dir.
Fix the error in the code that tries to add /opt/bin to PATH but overwrites it.
export PATH=[1]:/opt/binUsing PATH without $ treats it as a string, not the variable's value. Use $PATH to get the current PATH contents.
Fill both blanks to permanently add /custom/bin to PATH in the .bashrc file.
echo 'export PATH=[1]:[2]' >> ~/.bashrc
To add a directory permanently, append export PATH=$PATH:/custom/bin to ~/.bashrc. This keeps existing PATH and adds the new directory.
Fill all three blanks to create a script that adds /my/bin to PATH only if it's not already included.
if [[ ":$[1]:" != *":[2]:"* ]]; then export PATH=[3]:/my/bin fi
This script checks if /my/bin is in $PATH. If not, it prepends it. The syntax uses [[ ":$PATH:" != *":/my/bin:"* ]] for safe matching.