Created
June 10, 2019 20:06
-
-
Save dongcarl/c1032fd0236efd62ebc369931c339577 to your computer and use it in GitHub Desktop.
escaping should be added to list of hardest things in computer science
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
[dongcarl@dai tar-testing]$ REFERENCE_DATE=2019-01-01 | |
[dongcarl@dai tar-testing]$ REFERENCE_TIME=00:00:00 | |
[dongcarl@dai tar-testing]$ export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" | |
[dongcarl@dai tar-testing]$ echo $TAR_OPTIONS | |
--mtime=2019-01-01\ 00:00:00 | |
[dongcarl@dai tar-testing]$ tar -cf in.tar in/ | |
[dongcarl@dai tar-testing]$ tar tvf in.tar | |
drwxr-xr-x dongcarl/dongcarl 0 2019-01-01 00:00 in/ | |
-rw-r--r-- dongcarl/dongcarl 0 2019-01-01 00:00 in/hello | |
[dongcarl@dai tar-testing]$ unset TAR_OPTIONS | |
[dongcarl@dai tar-testing]$ rm in.tar | |
[dongcarl@dai tar-testing]$ tar --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME" -cf in.tar in/ | |
tar: Substituting -9223372036854775807 for unknown date format ‘2019-01-01\\\\ 00:00:00’ | |
[dongcarl@dai tar-testing]$ echo "$REFERENCE_DATE\\\ $REFERENCE_TIME" | |
2019-01-01\\ 00:00:00 | |
[dongcarl@dai tar-testing]$ tar tvf in.tar | |
drwxr-xr-x dongcarl/dongcarl 0 -9223372036854775808 in/ | |
-rw-r--r-- dongcarl/dongcarl 0 -9223372036854775808 in/hello | |
[dongcarl@dai tar-testing]$ exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment