#!/bin/bash
function thous {
numfmt --g $1 | sed 's/,/./g;s/@//g'
}
aa="1,235"
bb="5,22"
cc=$(echo "$aa + $bb" | bc)
#1
echo $aa
#2
echo $bb
#3
echo $(thous "$cc")
#4
echo "SKIP"
exit
What shown
(standard_in) 1: parse error
(standard_in) 1: parse error
1,235
5,22
What I want
(standard_in) 1: parse error
(standard_in) 1: parse error
1,235
5,22
(some error or nothing at all)
SKIP
If you try to compile this bash shell code, you will got stuck on #3. So, How to tell the terminal, to ignore whatever that cannot be processed and just go on the next process?
Please do tell me if the question is unclear, Thank you