In a shell pipeline, I compose a tar archive from a selection of files under a directory, taking the list of files from stdin, and write the archive to stdout. When I run tar like this:
tar cCTf directory - -
everything is fine. But when I try to run it like this:
tar cTCf - directory -
tar does not find the files, and I get the following error message:
tar: The following options were used after any non-optional
arguments in archive create or update mode. These options
are positional and affect only arguments that follow them.
Please, rearrange them properly.
tar: -C ‘directory' has no effect
What is wrong with the second command?
I am running GNU tar 1.34.
bsdtar?apt install bsdtarthenbsdtar cTCf - directory - > output.tarworks on my Ubuntu test machine.