xaav
xaav

Reputation: 7916

Invalid command name ' ' when running bash script

When running the following in a bash script:

python setup.py build_ext \ 
    --include-dirs=/root/deps/include:/root/deps/include/flint \
    --library-dirs=/root/deps/lib:/root/deps/lib/flint

I receive the following output:

invalid command name ' '

I am honestly at a loss to explain this output. I haven't seen it before and the command looks right. What could be causing it?

Upvotes: 0

Views: 536

Answers (1)

paxdiablo
paxdiablo

Reputation: 881393

Make sure those \ characters are the last thing on the line - it looks like you may have a space following one or more of them.

For example, here's a transcript of me putting a space after the \ in the first case but not in the second:

pax> python \ 
python: can't open file ' ': [Errno 2] No such file or directory

pax> python \
...> nofile.py
python: can't open file 'nofile.py': [Errno 2] No such file or directory

Ignore the fact that they both generate the same type of error, I couldn't be bothered creating a Python script for the second case. The important things is the \<space> is not seen as a line continuation character so the line is considered complete.

Upvotes: 3

Related Questions