Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a python programme, that accept I pass an argument inside it. But when I pass a very very long, it automatically shorten my argument. How can I fix it? Thanks.

share|improve this question
Can you show us the argument? – Simon Sheehan Dec 20 '11 at 4:21

Put all of the arguments in a text file, one per line. Then,

xargs python < argslist.txt

xargs reads in a list of tab, newline, or space-delimited arguments from standard in, and then feeds it to the utility to be executed after additional arguments on the command line.

So where here we have xargs utility arg1 < extraArgs.txt, xargs is going to execute utility, pass arg1 as the first argument and then since we are redirecting the contents of extraArgs.txt to xargs' standard in stream, it will append the arguments after arg1.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .