Answers for "bash set default value"

3

assign default value in shell script

FOO=${VARIABLE:-default}  # If variable not set or null, use default.
Posted by: Guest on June-01-2020
1

Setting default variable value in bash

FOO="${VARIABLE:=default}"  # If variable not set or null, set it to default.
Posted by: Guest on May-04-2021
0

set default shell to bash

#to change your default shell on any GNU/Linux distro 
#you need to use chsh

#For example if you want to change your default shell to bash
#you need to do this:
#first you need the full path to the bash executable
chsh -l

#then using the path for bash you need to write:
chsh -s /your/path/to/bash
#chsh -s /bin/bash for example
Posted by: Guest on February-28-2021

Browse Popular Code Answers by Language