Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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

bash add default argument

somecommand ${1:-foo}
Comment

PREVIOUS NEXT
Code Example
Shell :: touch command not working in vscode 
Shell :: make mp4 smaller using ffmpeg 
Shell :: tailwind nodejs 
Shell :: fzf install 
Shell :: how to download terminator in ubuntu 
Shell :: bash Creating help function 
Shell :: setting missing in ubuntu 
Shell :: git bash anaconda 
Shell :: show hidden files linux 
Shell :: remove local images 
Shell :: pwd in cmd 
Shell :: undo git add before commit 
Shell :: setup git in ubuntu 
Shell :: how to stop docker 
Shell :: list packages linux windows 
Shell :: ubuntu change directory owner 
Shell :: Pyrit download command for linux 
Shell :: dns_probe_finished_nxdomain linux ubuntu 
Shell :: powershell script path 
Shell :: how to use dotenv in javascript 
Shell :: edit global git config file 
Shell :: git see changes to one file 
Shell :: docker compose install debian 
Shell :: get file size in bash 
Shell :: fetching a forked branch 
Shell :: debian install postgresql 
Shell :: bash get first n characters 
Shell :: zsh: no matches found: with * 
Shell :: wsl home folder location 
Shell :: install psql 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =