Jump to content

command line arguments...

Recommended Posts

Hi,I am having trouble in passing < symbol as a command line argument. I have to pass file name after that < symbol from which my program will take the input.but when i pass this and print all the command line paramters in the main function it does not print < than sign and any argument that is written after that.....But when i pass the arguments using netbeans IDE by setting the project properties it works perfectly.here is the command i am using to run the program....java EightPuzzle -s BreadthFirst < file_that_takes_14_moves_to_solvethe file name "file_that_takes_14_moves_to_solve" and < than symbol is not printed when i pass it through command line.... but it does when i pass it through netbeans by setting the project properties......any help will be highly appreciated.Regards

Link to post
Share on other sites

Try putting the arguments in double quotes, i.e.

java EightPuzzle -s BreadthFirst "< file_that_takes_14_moves_to_solve"

Otherwise, the < sign is interpreted by the shell to mean "take the contents of file_that_takes_14_moves_to_solve and send it to the program's standard input"

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...