Created
February 28, 2021 23:31
-
-
Save patsma/c7ae3bec6da909f7f37abaf143ad0e9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why not cp to location 1, then mv to location 2. This takes care of "removing" the original. | |
And no, it's not the correct syntax. | is used to "pipe" output from one program and turn it into input for the next program. What you want is ;, which seperates multiple commands. | |
cp file1 file2 ; cp file1 file3 ; rm file1 | |
If you require that the individual commands MUST succeed before the next can be started, then you'd use && instead: | |
cp file1 file2 && cp file1 file3 && rm file1 | |
That way, if either of the cp commands fails, the rm will not run. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chain commands bash