Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to compare float values in shell script

# comparing floting points
compare=`echo | awk "{ print ($x < $y)?1 : 0 }"`
echo compare=$compare

if [[ $compare -eq 1 ]]; then
	echo x=$x is less than y=$y
elif [[ $compare -eq 0 ]]; then
	echo y=$y is less than x=$x
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: docker no space left on device 
Shell :: increment variable in batch file 
Shell :: powershell get ip from computer name 
Shell :: uninstall gns3 ubuntu 
Shell :: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted 
Shell :: npm install @emotion/core 
Shell :: vite react + eslint 
Shell :: powershell hidden window 
Shell :: create r anaconda environment 
Shell :: where is my .git config mac 
Shell :: ubuntu echo create file 
Shell :: tmux how to kill all sessions 
Shell :: how to search all subfolders in linux for file 
Shell :: extract a tar.xz file linux 
Shell :: ubuntu bionic update security has sum mismatch 
Shell :: update index assume changed 
Shell :: for loop batch 
Shell :: download adobe reader linux 
Shell :: how to start a web server linux 
Shell :: linux find text in pdf file 
Shell :: add docker to group 
Shell :: bash test boolean 
Shell :: linux query port use by pid 
Shell :: gcloud disable interactive prompts 
Shell :: warp out files in linux 
Shell :: mac ssh-keyscan a repo de azure 
Shell :: install anydesk snap linux mint 
Shell :: docker build no cache layer dockerfile --no-cache "docker-compose" context 
Shell :: terminal list items in directory 
Shell :: git log with author oneline 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =