how to send 2 variable value from bash script into java.class
#!/bin/bash
a=10
b=20
echo $a $b | java addition
done
hi there,
currently i have a simple java coding ( a + b ). and i m trying to connect with bash script but this bash script coudln't Enter 2nd value (b=20) while i running for it. may i know how do i can Enter 2 value into it?
output from terminal
[seng@localhost java_class]$ bash addition.sh
=======================================================================
simulation 1
Num_a= 10
Num_b= 20
Enter your Num_a : 10
Enter your Num_b : Exception in thread"main" java.lang.NumberFormatException
at java.lang.Integer.parseInt(java.lang.String, int,boolean) (/usr/lib/libgcj.so.6.0.0)
at java.lang.Integer.parseInt(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at filter_god.GOD(java.util.List, java.util.List, java.lang.String, java.lang.String,int) (Unknown Source)
at filter_god.main(java.lang.String[]) (Unknown Source)
at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
=======================================================================

