7 Replies Latest reply on Jul 14, 2011 8:32 AM by Bill Robinson

    Using math expressions with variables

      Hi, here I am again.


      Today I created a bash script (called Expr_test.sh) with this simple code:




      echo $1 > /tmp/output

      echo $2 >> /tmp/output


      The two variables are passed to the script through an external command inside a BLPackage.

      The BLPackage external command contains this code:


      dos2unix /tmp/Expr_test.sh

      chmod +x /tmp/Expr_test.sh

      /tmp/Expr_test.sh ??port.starting_port??


      where starting_port is a custom property defined inside the property dictionary and port is a BLPackage local property and represent a port to associate to an IP address.


      Now what I'd like to know is if it's possible to use math operations with variables in order to obtain in output the starting port and subsequent ports.

      I try to use something like that:


      dos2unix /tmp/Expr_test.sh

      chmod +x /tmp/Expr_test.sh

      /tmp/Expr_test.sh ??port.starting_port?? ??port.starting_port??+1


      thinking I get in output, (with starting_port = 8080):




      but it didn't work. So, how can I reach my scope?