selftaught91
selftaught91

Reputation: 7461

Nodejs to accept command line argument that contain ( or )

I have made a node application that take any text as argument and my application takes that text and stores that in the database.

When I am giving any text that contain the ( or ) in it then I get an error from bash as

-bash: syntax error near unexpected token `('

How can i accept arguments which contain ( or ) in the text

Upvotes: 0

Views: 66

Answers (1)

robertklep
robertklep

Reputation: 203304

Quote the argument(s), preferably using single quotes:

node app.js 'foo ( or ) bar'

Upvotes: 2

Related Questions