How can I copy the numeric value in a variable to another variable in bash script. If this were C, I would do
int a=0; int b; a=b;
I am trying to do this:
if [ $countip -gt $totalip ]; then $countip -eq $srctip # <-- My problem is here! echo $srctip fi
Just say
countip=$srctip
This is how assignment works in bash. This will set countip to the value of srctip. If you want to assign srctip then just write
srctip=$countip
Based on the comments below this looks like the one you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With