Edwin Fine, Gleb Peregud thanks for your suggestions. It looks like my decision to use escript was a mistake. Now I'm going to try bash for that. -- Sergey