Relative Content

Tag Archive for shellgo

Ubuntu Shell Capture using Go

I want to make a automatic shell script.
and capture whole things of shell like input, output and error just like any terminal.
this script is for remote server(ubuntu).
I have tried my ways to do it but not working as I expected.
I am able to do anything but can’t handle one condition that is If execute command with ‘sudo’ so asking for the password in terminal I am able to provide the password via terminal but I want to provide hardcoded password whenever will ask for the password. I can do this also using ‘stdinpipe’ but this thing pass the password every time. so I want to pass password according to output if ask for password only then pass otherwise not.
for example-