Echo in prolog with single print
Please consider using format/2 for formatting output.

You do not need so many concatenations!

Also, check out the following sample query and interaction:


?- main([test]).
test
true ;
test 
true ;
false.


This shows that internally, there are choice-points left, and in fact even alternative solutions.

Ideally, the predicate should be deterministic, i.e., succeed exactly&nbsp;once.