Unable to add commands to bashShell script printing blank $USER variable when executed by SmartdCasperJS and...
Coffee Grounds and Gritty Butter Cream Icing
Using the Grappler feat, can you grapple and pin (restrain) in the same action?
As an interviewer, how to conduct interviews with candidates you already know will be rejected?
Are there manual immigration checks for non EU citizens in airports when travelling inside the EU?
Does python reuse repeated calculation results?
Why is the time of useful consciousness only seconds at high altitudes, when I can hold my breath much longer at ground level?
Would we have more than 8 minutes of light, if the sun "went out"?
Has a hard SciFi story addressed launching from Venus and its high-density atmosphere, especially after 1967?
How to change the order of integration when limit is a function?
Can I pay off my mortgage with a new one?
How to be productive while waiting for meetings to start
How to get a smooth, uniform ParametricPlot of a 2D Region?
Is negative resistance possible?
Can/should you swim in zero G?
In 1700s, why was 'books that never read' grammatical?
What is /dev/null and why can't I use hx on it?
How to print variable value in next line using echo command
Scorched receptacle
How to "Start as close to the end as possible", and why to do so?
Could the Queen overturn the UK Supreme Court ruling regarding prorogation of Parliament?
Is power set functor determined by its image on objects?
Can an animal produce milk all the time?
Determine the Winner of a Game of Australian Football
Generating Roman numerals with dice
Unable to add commands to bash
Shell script printing blank $USER variable when executed by SmartdCasperJS and PHP In Cron Job Cannot Open Files, Works Fine When Run ManualyImproving my Bash scriptshell script works fine when executed in terminal, but errors out when ran as concurrent programHow do I check for the existence of a process without a failed exit code being returned?How to find available commands in SDF's unvalidated default shell?Unable to attach a .txt file or .log file to mail and mailx commandBash Shell URL built with variables are missing after inserting behind http://execute command with sudo and execute Bash script with sudo
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
I am running a bash script but once I "become bash" I am unable to add further commands (or they are not executed).
I just need a bash script which does the three short commands from the screenshot by itself and returns the result of the 'whoami' command.

So the result of running the bash script should be the output 'alice'.
My current script is this:
#!/bin/bash
cd ~
touch support.sh
echo '#!/bin/bash' > support.sh
chmod a+x support.sh
echo ' ;/bin/bash -p -i' >> support.sh
echo 'whoami' >> support.sh
cd /home/alice/Public
./alice-secret < ~/support.sh
linux bash shell-script shell command-line
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
I am running a bash script but once I "become bash" I am unable to add further commands (or they are not executed).
I just need a bash script which does the three short commands from the screenshot by itself and returns the result of the 'whoami' command.

So the result of running the bash script should be the output 'alice'.
My current script is this:
#!/bin/bash
cd ~
touch support.sh
echo '#!/bin/bash' > support.sh
chmod a+x support.sh
echo ' ;/bin/bash -p -i' >> support.sh
echo 'whoami' >> support.sh
cd /home/alice/Public
./alice-secret < ~/support.sh
linux bash shell-script shell command-line
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment
|
I am running a bash script but once I "become bash" I am unable to add further commands (or they are not executed).
I just need a bash script which does the three short commands from the screenshot by itself and returns the result of the 'whoami' command.

So the result of running the bash script should be the output 'alice'.
My current script is this:
#!/bin/bash
cd ~
touch support.sh
echo '#!/bin/bash' > support.sh
chmod a+x support.sh
echo ' ;/bin/bash -p -i' >> support.sh
echo 'whoami' >> support.sh
cd /home/alice/Public
./alice-secret < ~/support.sh
linux bash shell-script shell command-line
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am running a bash script but once I "become bash" I am unable to add further commands (or they are not executed).
I just need a bash script which does the three short commands from the screenshot by itself and returns the result of the 'whoami' command.

So the result of running the bash script should be the output 'alice'.
My current script is this:
#!/bin/bash
cd ~
touch support.sh
echo '#!/bin/bash' > support.sh
chmod a+x support.sh
echo ' ;/bin/bash -p -i' >> support.sh
echo 'whoami' >> support.sh
cd /home/alice/Public
./alice-secret < ~/support.sh
linux bash shell-script shell command-line
linux bash shell-script shell command-line
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 12 mins ago
PeterParkerPeterParker
1
1
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
PeterParker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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/4.0/"u003ecc by-sa 4.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
});
}
});
PeterParker is a new contributor. Be nice, and check out our Code of Conduct.
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%2f544251%2funable-to-add-commands-to-bash%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
PeterParker is a new contributor. Be nice, and check out our Code of Conduct.
PeterParker is a new contributor. Be nice, and check out our Code of Conduct.
PeterParker is a new contributor. Be nice, and check out our Code of Conduct.
PeterParker is a new contributor. Be nice, and check out our Code of Conduct.
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%2f544251%2funable-to-add-commands-to-bash%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