command_line() with *
- Posted by georgeorr Apr 16, 2009
- 925 views
I am working on a simple command line calculator and wanted to pull the command line into the program for immediate execution. I used the command_line() function for this and it works fine except that when it encounters an * on the command line it seems to expand it into a list of the files and directories in the current folder. I have not found anything in the documentation that would have made me expect this sort of behavior. Is this a feature or a bug? Has anyone else encountered this? Details are below
I can get around this by quoting the command line, but this is a bit awkward for a command line calculator!
My code (in a file called "cline" is
-- checking Command Line include pretty.e sequence cline cline = command_line() pretty_print(1,cline,{2}) puts(1,"\n\n")
When I execute with files "Another file", "cline", and "emake" in the current directory I get
eui cline test * test
with I get
{ "/home/george/EU40_2/bin/eui", "cline", "test", "Another file", "cline", "emake", "test" }