Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

assign default value in shell script

FOO=${VARIABLE:-default}  # If variable not set or null, use default.
Comment

Setting default variable value in bash

FOO="${VARIABLE:=default}"  # If variable not set or null, set it to default.
Comment

default parameter value in bash

VAR=${1:-DEFAULTVALUE}
Comment

Default parameter value in bash

function server() {
    local port="${1:-8000}"
    python -m SimpleHTTPServer "$port"
}
Comment

PREVIOUS NEXT
Code Example
Shell :: angular cli generate new module 
Shell :: grep text in files 
Shell :: install geopandas 
Shell :: delete all files smaller than a certain size linux 
Shell :: ubuntu print path 
Shell :: geopandas is not installin 
Shell :: git change crlf to lf 
Shell :: unix replace comma with tab 
Shell :: npm install moment 
Shell :: install readline-sync 
Shell :: go update all packages 
Shell :: uninstall mongoose using npm 
Shell :: git ubuntu store credential 
Shell :: name of exe on ubuntu 20.04 terminal 
Shell :: sudoers nopasswd 
Shell :: styled components props typescript 
Shell :: tar bash 
Shell :: how to completely remove apps ubuntu package 
Shell :: apache config file 
Shell :: change default directory of the server 
Shell :: stash unstaged changes 
Shell :: set domain name for localhost ubuntu 
Shell :: change partition in cmd 
Shell :: cron logs 
Shell :: system program error detected ubuntu 
Shell :: please reinstall android studio from scratch 
Shell :: bash get file name 
Shell :: Linux command line search and replace string 
Shell :: hardhat compile 
Shell :: net user administrator active yes 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =