Lesson 1

Date: 1/22/2014
User accounts, files and directories, processes, system commands.
Linux for Engineering and IT Applications


Linux shells


  • When you login to a Linux system, you get a command shell.

  • Shells are listed in /etc/shells. Default Linux shell: bash

  • System commands, scripts and applications run in the shell - they become child processes of the shell.

  • Shell variables are local to the shell.

  • A shell variable becomes an environment variable after executing command export on it:
     svar=VAR_1  #initialize shell variable
     export svar #becomes environment variable
     env | grep svar 
    
    Environment variables are inherited by the child shells and processes.

  • Commands executed in the shell should be either built-in shell commands, or addressed with the full path, or located in the PATH env. variable.
      echo $PATH
    

    Exercise
    Create a new shell variable, svar:
    svar=VAR_1
    echo $svar
    
    Start a new child shell and see if svar is defined there:
    bash
    echo $svar
    
    Exit from the child shell, export the variable, and see if it is defined in a child shell:
    exit
    export svar
    bash
    echo $svar
    



  • Take me to the Course Website