awk if else statement
# Basic syntax:
awk 'BEGIN {if(condition) outcome}' # if
awk 'BEGIN {if(condition_1) outcome_1; else outcome_2}' # if else
awk 'BEGIN {if(condition_1) outcome_1; else if(condition_2) outcome_2}' # if else if
# Example usage:
awk 'BEGIN {if(2>3) print "1_is_true"; else print 6}'
--> 6
# For multi-line and ternary operator syntax, see source
Also in C++:
- Title
- fast backup mac
- Category
- C++
- Title
- How to tell ping to exit after a specified number of ECHO_REQUEST packets
- Category
- C++
- Title
- create user ubuntu 20.04
- Category
- C++
- Title
- install docker compose in suse linux
- Category
- C++
- Title
- pgzint install windows 10
- Category
- C++
- Title
- sed line
- Category
- C++
- Title
- python check version
- Category
- C++
- Title
- get the size of files in a directory linux
- Category
- C++
- Title
- linux repository list
- Category
- C++
- Title
- git move branch to previous commit
- Category
- C++
- Title
- site:github.com speedtest web app
- Category
- C++
- Title
- cp with folder structure
- Category
- C++
- Title
- install mcrypt extension centos 7
- Category
- C++
- Title
- install dvc in ubuntu
- Category
- C++
- Title
- install jq command
- Category
- C++
- Title
- how to remove remote origin git
- Category
- C++
- Title
- how to shutdown port in windows
- Category
- C++
- Title
- how to install mariadb on debian
- Category
- C++
- Title
- git reset last commit
- Category
- C++
- Title
- tr replace char for
- Category
- C++
- Title
- bbedit close without saving
- Category
- C++
- Title
- create soft link in linux
- Category
- C++
- Title
- angular compile cache clear
- Category
- C++
- Title
- ubuntu undelete a whole directory
- Category
- C++