index = `cat /tmp/myfile.index` $index = $index + 1 echo $index > /tmp/myfile.index exit 0 #### $index = `cat /tmp/myfile.index`; $index = $index + 1; system "echo $index > /tmp/myfile.index"; exit 0;