Skip to content

PiLa-DZ/BashScript-Reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 

Repository files navigation

BashScript-Reference

  1. echo $SHELL

    Output: /bin/bash

  2. bash app.sh
  3. #!/bin/bash
  4. chmod u+x app.sh

  1. $VARIABLE_NAME
  2. read
  3. if   [ $X = $Y ]; then
       	    # Do Something
    elif [ $X = $Z ]; then
       	    # Do Something
    else
       	    # Do Something
    fi
    
  4. case $X in
        $Y | $Z)
    	# Do Somethisg
    	;;
        $A)
    	# Do Somethisg
    	;;
        *)
    	# Do Somethisg
    	;;
    esac
    
  5. MY_ARRAY=(one two three)
    echo ${MY_ARRAY[@]}

    Output: one two three

    echo ${MY_ARRAY[0]}

    Output: one

    echo ${MY_ARRAY[1]}

    Output: two

    echo ${MY_ARRAY[2]}

    Output: three


Learn From Youtube 😊

Bash Scripting Tutorial

Releases

No releases published

Packages

 
 
 

Contributors

Languages