How to do pbrun and exit in a script?Prompt for sudo password and programmatically elevate privilege in bash...
What are the characteristics of a typeless programming language?
How much cash can I safely carry into the USA and avoid civil forfeiture?
"You've called the wrong number" or "You called the wrong number"
How to have a sharp product image?
How could Tony Stark make this in Endgame?
What's the polite way to say "I need to urinate"?
What is causing the white spot to appear in some of my pictures
A Paper Record is What I Hamper
Is Diceware more secure than a long passphrase?
How to write a column outside the braces in a matrix?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
What does ゆーか mean?
Is it idiomatic to construct against `this`
Can SQL Server create collisions in system generated constraint names?
Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?
Is there any official lore on the Far Realm?
How can I practically buy stocks?
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
Map of water taps to fill bottles
How come there are so many candidates for the 2020 Democratic party presidential nomination?
How do I reattach a shelf to the wall when it ripped out of the wall?
If a planet has 3 moons, is it possible to have triple Full/New Moons at once?
What happens to Mjolnir (Thor's hammer) at the end of Endgame?
How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?
How to do pbrun and exit in a script?
Prompt for sudo password and programmatically elevate privilege in bash script?How to write an abort-on-error script without adding `|| exit $?` to every line?How to stop regular users from Switching UsersBash script and stdinHow do I check for the existence of a process without a failed exit code being returned?bash script trap for exit and err and logic for differencehow to warn about user quotas of ftp user in a /sbin/nologin shell?How to run script as restricted user?How to extract every command line, exit code and stdout/stderr in one scriptRun entire bash script as root or use sudo on the commands that need it?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am writing a script for a daily activities and as a part of that I need to do multiple pbrun
commands.
pbrun /bin/su -s /bin/bash xerox
pbrun /bin/su - margo
In a script I want to do pbrun and do the job and exit. Then do anonther pbrun and repeat.
If the user is not able to or unauthorized, I should be able to throw the message as warning.
Can you give me the snippet?
bash sudo
add a comment |
I am writing a script for a daily activities and as a part of that I need to do multiple pbrun
commands.
pbrun /bin/su -s /bin/bash xerox
pbrun /bin/su - margo
In a script I want to do pbrun and do the job and exit. Then do anonther pbrun and repeat.
If the user is not able to or unauthorized, I should be able to throw the message as warning.
Can you give me the snippet?
bash sudo
add a comment |
I am writing a script for a daily activities and as a part of that I need to do multiple pbrun
commands.
pbrun /bin/su -s /bin/bash xerox
pbrun /bin/su - margo
In a script I want to do pbrun and do the job and exit. Then do anonther pbrun and repeat.
If the user is not able to or unauthorized, I should be able to throw the message as warning.
Can you give me the snippet?
bash sudo
I am writing a script for a daily activities and as a part of that I need to do multiple pbrun
commands.
pbrun /bin/su -s /bin/bash xerox
pbrun /bin/su - margo
In a script I want to do pbrun and do the job and exit. Then do anonther pbrun and repeat.
If the user is not able to or unauthorized, I should be able to throw the message as warning.
Can you give me the snippet?
bash sudo
bash sudo
asked 57 mins ago
VajraVajra
103
103
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f515818%2fhow-to-do-pbrun-and-exit-in-a-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f515818%2fhow-to-do-pbrun-and-exit-in-a-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown