Hi,
I have a query. How to print sum of two user defined variables. let us take var1 is 6 and var2 is 4. sum should dispay 10 on terminal.
read number
expr 500 \* ${$var1} / 100
expr $above_output \* ${$var2} /100
expr $above_output \* ${$var3} /100
#!/bin/bash var1=$(nc -dvzw5 thebes.openshells.net 22) var2='Connection to thebes.openshells.net 22 port [tcp/ssh] succeeded!' if [ "$var1" = "$var2" ]; then echo TRUE else echo FALSE fi
#!/bin/bash # This line works as expected.... echo "the user is <$USER> and the hostname is <$HOSTNAME>" MYVAR1=bill MYVAR2=fred # This lines doesn't..... echo "my first variable is<$MYVAR1> and my second is <$MYVAR2>"
ssh $a@$b mkdir abc