bash - Does the the order of command line flags matter? -


this question has answer here:

i testing hugo static blog generator comes themes , example sites within them.

in order use examplesite, copy content it's content hugo project root. while did this, noticed where, put -flag args seems important.

is normal bash behavior or introduced zsh?

this command didn't work

cp themes/hugo-theme-bootstrap4-blog/examplesite/* . -r 

this command worked!

cp -r themes/hugo-theme-bootstrap4-blog/examplesite/* . 

cp own command, provided os vendor. neither bash nor zsh controls behavior of cp.

the posix standard requires cp accept options before arguments. given in posix utility syntax guidelines, entry #9:

  1. all options should precede operands on command line.

gnu tools go beyond requirement, accepting options after arguments unless -- given prior (as described in guideline #10).


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -