I study Git ( link text ) and came across this command:

ls -C .git/objects/<dir> 

and when I entered it into GitBash, I received the following error:

sh: syntax error near unexpected token 'newline'

I searched the whole Internet, I can not find how to fix it. The only thing I realized that the problem is contained in the "<>". Apparently, Git Bash does not understand brackets.

  • > Apparently, Git Bash does not understand brackets. > and < are standard output and input control statements. And under the <dir> in the manual is meant an arbitrary folder, for that brackets and highlighted. - etki
  • @Etki, here again, the perfect answer. Why does he comment? =) - Sergiks
  • @sergiks, because there is no detailed analysis of operators and what is described in the manual. I am for the answers to the content were as answers to so, to which Google displays on banal questions. - etki
  • @Etki, with your answer you do not deprive others of the opportunity to write a more detailed one. Your comment, in my opinion, satisfies the minimum viable answer requirement, let's say (by analogy with MVP ) - it allows the stuck vehicle to take the next step. - Sergiks

1 answer 1

response from comment:

Apparently, Git Bash does not understand brackets. > and < are standard output and input control statements. And under the <dir> in the manual is meant an arbitrary folder, for that brackets and highlighted.

  • gitbash understands angle brackets just like bash. You can try to execute this command in a normal bash, get the same result. Just the angle bracket at the end of the line is a syntax error. - Roman