The problem seems to come from the \ sign that appears at line: set gambv = `gensky $skypar | rcalc -i '# Ground ambient\ level: ${ga}' -e '$1=ga'` Just replace this line by: set gambv = `gensky $skypar | rcalc -i '# Ground ambient level: ${ga}' -e '$1=ga'` and the script should work now... Rapha�l