Syntax error near unexpected token `done'
I'm trying to get this while loop (using nano) to download some websites from this URL but I keep getting the error "syntax error near unexpected token `done'":
while read <FIRST-LAST> do
echo FIRST-LAST
curl -O https://www.uoguelph.ca/arts/history/people/FIRST-LAST
done < formatted_history.txt
bash shell-script shell
add a comment |
I'm trying to get this while loop (using nano) to download some websites from this URL but I keep getting the error "syntax error near unexpected token `done'":
while read <FIRST-LAST> do
echo FIRST-LAST
curl -O https://www.uoguelph.ca/arts/history/people/FIRST-LAST
done < formatted_history.txt
bash shell-script shell
add a comment |
I'm trying to get this while loop (using nano) to download some websites from this URL but I keep getting the error "syntax error near unexpected token `done'":
while read <FIRST-LAST> do
echo FIRST-LAST
curl -O https://www.uoguelph.ca/arts/history/people/FIRST-LAST
done < formatted_history.txt
bash shell-script shell
I'm trying to get this while loop (using nano) to download some websites from this URL but I keep getting the error "syntax error near unexpected token `done'":
while read <FIRST-LAST> do
echo FIRST-LAST
curl -O https://www.uoguelph.ca/arts/history/people/FIRST-LAST
done < formatted_history.txt
bash shell-script shell
bash shell-script shell
edited Aug 25 '18 at 10:05
Tshepang
26.1k71186264
26.1k71186264
asked Jan 20 '17 at 0:28
Daniela BustamanteDaniela Bustamante
2314
2314
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
- Either the
do
should appear on a new line, or it needs to have a semi-colon inserted in front of it
<FIRST-LAST>
should actually be the name of a shell variable, andFIRST-LAST
should be a reference to that variable.<
and>
are not legal characters for shell variables, so we can deduce that something else must be substituted here instead.person
seems to be as good a variable name as any in this particular case.
I think something like this should work much better:
while read person ; do
echo "${person}"
curl -O "https://www.uoguelph.ca/arts/history/people/${person}"
done < formatted_history.txt
This assumes that the file formatted_history.txt
actually exists in the current directory and is a list of people from the https://www.uoguelph.ca/arts/history/people/ page - something like:
tara-abraham
donna-andrew
susan-armstrong-reid
... etc ...
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
add a comment |
I'm trying to execute below in git bash but I keep getting the error "syntax error near unexpected token `done'"
Could you please help out
if [ ! -e ~/.ssh/id_rsa ]; then ssh-keygen -b 4096; done
New contributor
add a comment |
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%2f338757%2fsyntax-error-near-unexpected-token-done%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
- Either the
do
should appear on a new line, or it needs to have a semi-colon inserted in front of it
<FIRST-LAST>
should actually be the name of a shell variable, andFIRST-LAST
should be a reference to that variable.<
and>
are not legal characters for shell variables, so we can deduce that something else must be substituted here instead.person
seems to be as good a variable name as any in this particular case.
I think something like this should work much better:
while read person ; do
echo "${person}"
curl -O "https://www.uoguelph.ca/arts/history/people/${person}"
done < formatted_history.txt
This assumes that the file formatted_history.txt
actually exists in the current directory and is a list of people from the https://www.uoguelph.ca/arts/history/people/ page - something like:
tara-abraham
donna-andrew
susan-armstrong-reid
... etc ...
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
add a comment |
- Either the
do
should appear on a new line, or it needs to have a semi-colon inserted in front of it
<FIRST-LAST>
should actually be the name of a shell variable, andFIRST-LAST
should be a reference to that variable.<
and>
are not legal characters for shell variables, so we can deduce that something else must be substituted here instead.person
seems to be as good a variable name as any in this particular case.
I think something like this should work much better:
while read person ; do
echo "${person}"
curl -O "https://www.uoguelph.ca/arts/history/people/${person}"
done < formatted_history.txt
This assumes that the file formatted_history.txt
actually exists in the current directory and is a list of people from the https://www.uoguelph.ca/arts/history/people/ page - something like:
tara-abraham
donna-andrew
susan-armstrong-reid
... etc ...
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
add a comment |
- Either the
do
should appear on a new line, or it needs to have a semi-colon inserted in front of it
<FIRST-LAST>
should actually be the name of a shell variable, andFIRST-LAST
should be a reference to that variable.<
and>
are not legal characters for shell variables, so we can deduce that something else must be substituted here instead.person
seems to be as good a variable name as any in this particular case.
I think something like this should work much better:
while read person ; do
echo "${person}"
curl -O "https://www.uoguelph.ca/arts/history/people/${person}"
done < formatted_history.txt
This assumes that the file formatted_history.txt
actually exists in the current directory and is a list of people from the https://www.uoguelph.ca/arts/history/people/ page - something like:
tara-abraham
donna-andrew
susan-armstrong-reid
... etc ...
- Either the
do
should appear on a new line, or it needs to have a semi-colon inserted in front of it
<FIRST-LAST>
should actually be the name of a shell variable, andFIRST-LAST
should be a reference to that variable.<
and>
are not legal characters for shell variables, so we can deduce that something else must be substituted here instead.person
seems to be as good a variable name as any in this particular case.
I think something like this should work much better:
while read person ; do
echo "${person}"
curl -O "https://www.uoguelph.ca/arts/history/people/${person}"
done < formatted_history.txt
This assumes that the file formatted_history.txt
actually exists in the current directory and is a list of people from the https://www.uoguelph.ca/arts/history/people/ page - something like:
tara-abraham
donna-andrew
susan-armstrong-reid
... etc ...
edited Jan 20 '17 at 16:54
DopeGhoti
45.9k55988
45.9k55988
answered Jan 20 '17 at 0:40
Digital TraumaDigital Trauma
5,90211528
5,90211528
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
add a comment |
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
3
3
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
THANK YOU SO MUCH! This worked perfectly, I can't explain how long this has taken me and you just answered it. Thank you!!!
– Daniela Bustamante
Jan 20 '17 at 1:14
add a comment |
I'm trying to execute below in git bash but I keep getting the error "syntax error near unexpected token `done'"
Could you please help out
if [ ! -e ~/.ssh/id_rsa ]; then ssh-keygen -b 4096; done
New contributor
add a comment |
I'm trying to execute below in git bash but I keep getting the error "syntax error near unexpected token `done'"
Could you please help out
if [ ! -e ~/.ssh/id_rsa ]; then ssh-keygen -b 4096; done
New contributor
add a comment |
I'm trying to execute below in git bash but I keep getting the error "syntax error near unexpected token `done'"
Could you please help out
if [ ! -e ~/.ssh/id_rsa ]; then ssh-keygen -b 4096; done
New contributor
I'm trying to execute below in git bash but I keep getting the error "syntax error near unexpected token `done'"
Could you please help out
if [ ! -e ~/.ssh/id_rsa ]; then ssh-keygen -b 4096; done
New contributor
New contributor
answered 10 mins ago
AnushaAnusha
1
1
New contributor
New contributor
add a comment |
add a comment |
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%2f338757%2fsyntax-error-near-unexpected-token-done%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