This content originally appeared on DEV Community and was authored by Lyner Lim
If you’re using the terminal on Linux or Mac, echo <password> | sudo -S <command>.
If you’re doing this programmatically, for example in Python, os.system(f'echo {password} | sudo -S {command}').
This content originally appeared on DEV Community and was authored by Lyner Lim
Lyner Lim | Sciencx (2024-10-26T02:15:09+00:00) How to Enter Your Password for sudo in a Single Command. Retrieved from https://www.scien.cx/2024/10/26/how-to-enter-your-password-for-sudo-in-a-single-command/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.