cssGEEK
cssGEEK

Reputation: 1014

bash: syntax error near unexpected token `;;'

I have a github project, where inside my directory there is a file called "app;;settings.dat".

When I want to add this file to commit, I write the following command:

git add app;;settings.dat

but it gives me the following error:

bash: syntax error near unexpected token `;;'

Any ideas why?

Upvotes: 1

Views: 3063

Answers (2)

Deb
Deb

Reputation: 2972

; is special character bash. You have to escape it.

Try

git add app\;\;settings.dat

Upvotes: 1

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272477

; is a special character in Bash (it's used to separate commands on a single line). Try this:

git add "app;;settings.dat"

(And more generally, try to avoid using ; in filenames!)

Upvotes: 5

Related Questions