I have a linux shell calculation, something like this
echo "scale 4;3*2.5" |bc
which gives me the result, now I like to pass the result of this calculation to a variable so that I can use it later in another command,
Working with files in files, but not connecting to variables
echo "scale=4 ; 3*2.5" | bc > test.file
so in pseudo code i'm looking for something like this
set MYVAR=echo "scale=4 ; 3*2.5" | bc ; mycommand $MYVAR
Any ideas?
source
share