# keep getting : not found



## lovepony (Aug 9, 2010)

```
#!/bin/sh
# Latency menu 

while [ answer != "0" ] 
do
clear
echo "----------------------------------------"
echo "***     Lacency configuration        ***"
echo "----------------------------------------"
echo "Select a number and press Enter"
echo "  1  Set user defined Latency"


read -p " ?" answer
    case $answer in
        0) break ;;
        1)echo "Indtast din onskede latency" 
	  read user_latency
	   echo "Du skrev $user_latency"
	   my2="2"
	   echo "$my2"
	   test= `expr $user_latency / $my2`
	   echo "$test"
	   
	   ipfw pipe 1 config delay $test
```


----------



## lovepony (Aug 9, 2010)

can't figure out how to edit my tread so here are some more info  

I'm starting to build my first sh script and I'm running into some problems , my only scripting / programming experience is from windows.

This is kinda working but i keep getting : not found in my echo "$test" , it does the calculation but it adds : not found. so a print would look like 500:not found


----------



## lovepony (Aug 9, 2010)

Figured it out my self , was a syntax error. 

changed 
	
	



```
test= `expr $user_latency / $my2`
```

to 


```
test=`expr $user_latency / $my2`
```



thanks anyway for a great forum


----------



## camelia (Aug 9, 2010)

There is builtin arithmetic parser, i.e. $((...)). It's supported by all ash descendants as well as bash/zsh.

```
$ user_latency=10
$ my2=2
$ echo $(( user_latency / my2 ))
5
```


----------



## camelia (Aug 9, 2010)

In other words this





> ```
> echo "Du skrev $user_latency"
> my2="2"
> echo "$my2"
> ...


can be reduced to
	
	



```
echo "Du skrev $user_latency"
echo $(( my2 = 2 ))
echo $(( test = user_latency / my2 ))
```


----------

