Created
July 30, 2019 12:37
-
-
Save vipulgupta2048/5b2f321468fd69941997575e54105914 to your computer and use it in GitHub Desktop.
[Homework] Creating your own copy util for Linux Distributions
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import sys | |
| import shutil | |
| arg = sys.argv | |
| source = str(arg[1:2])[2:-2] | |
| dest = str(arg[2:3])[2:-2] | |
| print("Source location of the file is {}".format(source)) | |
| print("Destination of the file {}".format(dest)) | |
| new = shutil.copy(source, dest, follow_symlinks=True) | |
| print("copying ......... DONE!") | |
| print("Files have been moved to {}".format(new)) | |
| # instructions: Copy file to /bin directory, run command `sudo chmod 777 vipulcopy` to use this as a command in the terminal | |
| # Author: vipulgupt2048 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment