Oskar Liljeblad wrote: > Bob Proulx wrote: > [..] > > GNU mv will conform strictly to standard behavior if POSIXLY_CORRECT > > is set. > > > > touch a > > mv a -- b > > touch a > > POSIXLY_CORRECT=1 mv a -- b > > mv: when moving multiple files, last argument must be a directory > > Try `mv --help' for more information. > > Ah, so there we have it. Well, since "--" is unusable with POSIXLY_CORRECT > enabled (right?),
Works fine with POSIXLY_CORRECT. As long as the command is in standard form with options before non-options. touch a POSIXLY_CORRECT=1 mv -- a b > imv will have to either get rid of "--" or test for > POSIXLY_CORRECT itself? The best case would be to move the "--" after options and before non-options. That is, move it before any possible file names. That is standard form. You should do this because that takes care of the case that a filename might look like an option. touch ./--help mv --help b ...help output deleted... So you should keep the "--" but you should put it after any options and before any filenames. touch ./--help mv -v -- --help b `--help' -> `b' Otherwise you would need to worry about filenames causing trouble. In your original case with "mv a -- b" if the "a" filename was really "-something" it would generate an error about -s not being a valid option. It would be a data dependent error case. Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
