I have below lines in my shell script.
#!/bin/bash
counter=0
counter=$((counter+1))
echo $counter
And I need to run the above shell script like this-
sh -x test.sh
Whenever I try to run the above script, I awlays get error as –
`counter=$' unexpected
Any suggestions what changed I need to make there?
Updated Script:
#!/bin/bash
counter=0
counter=$(($counter+1))
echo $counter
Try:
$ sh -x test.sh