How may I provide my password repeatedly to a script contaning a loop of sudo?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a script which contains
while true
sudo mycmd
sleep 10000
[ ... ] ; break
end
when I run the script in bash, I will have to provide my password once in 10000 seconds after finishing running the previous instance of sudo mycmd
.
I remeber yes | somecommand
can repeatedly provide yes
as stdin input to somecommand
, as answers to repeated questions of "Yes or No". I wonder how I can provide my password repeatedly to the script?
Thanks.
bash scripting sudo
add a comment |Â
up vote
0
down vote
favorite
I have a script which contains
while true
sudo mycmd
sleep 10000
[ ... ] ; break
end
when I run the script in bash, I will have to provide my password once in 10000 seconds after finishing running the previous instance of sudo mycmd
.
I remeber yes | somecommand
can repeatedly provide yes
as stdin input to somecommand
, as answers to repeated questions of "Yes or No". I wonder how I can provide my password repeatedly to the script?
Thanks.
bash scripting sudo
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a script which contains
while true
sudo mycmd
sleep 10000
[ ... ] ; break
end
when I run the script in bash, I will have to provide my password once in 10000 seconds after finishing running the previous instance of sudo mycmd
.
I remeber yes | somecommand
can repeatedly provide yes
as stdin input to somecommand
, as answers to repeated questions of "Yes or No". I wonder how I can provide my password repeatedly to the script?
Thanks.
bash scripting sudo
I have a script which contains
while true
sudo mycmd
sleep 10000
[ ... ] ; break
end
when I run the script in bash, I will have to provide my password once in 10000 seconds after finishing running the previous instance of sudo mycmd
.
I remeber yes | somecommand
can repeatedly provide yes
as stdin input to somecommand
, as answers to repeated questions of "Yes or No". I wonder how I can provide my password repeatedly to the script?
Thanks.
bash scripting sudo
bash scripting sudo
asked 4 mins ago
Tim
24.4k69238426
24.4k69238426
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478801%2fhow-may-i-provide-my-password-repeatedly-to-a-script-contaning-a-loop-of-sudo%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password