I have a bash script that needs to run this command:
python manage.py test
But since test
is a bash command by itself, I need to escape it somehow. but couldn't found out how.
any leads? or maybe I'm worrying for nothing?
I have a bash script that needs to run this command:
python manage.py test
But since test
is a bash command by itself, I need to escape it somehow. but couldn't found out how.
any leads? or maybe I'm worrying for nothing?
test
is a Bash builtin command, not a keyword or reserved word. This means Bash will only interpret it if it is the first token in a command, likeIn
Bash will just pass it as a parameter to
python
(that is, it will executepython
with two parameters,manage.py
andtest
); you don't need to escape it.In general, Bash doesn't have reserved words in the sense of C-like languages. The only things you need to escape are whitespace (which Bash uses to separate params), and certain symbols including
$(&|;
which Bash uses for its variables and command separators.