http://qs321.pair.com?node_id=610681


in reply to Using system(): converting error num to human readable message

Looking at your code I think the error messages are valid.

In Test3, you try to run a valid command (ls) on a non-existant file (t.t).

However you're running 'someprog "var"' and 'somprog var' in Test2 and Test1 respectively. Unless you have two programs, someprog and somprog, you are going to get differing error messages relating to either non-existing files or an error in the someprog program.

If you have 'somprog' and 'someprog' it would be helpful to look at those scripts to see how they should be called. Do you have someprog and a typo in the program name 'somprog' or are these in fact two valid program calls?