Looking for an e.g. bash solution to check English verb conjugation
Hi I got interest in a solution posted here & put the suggested function in a bash script
leaving at ~/.bin
so, a dir
under path
. Then performed $chmod +x verbteacher.sh
for easy calling from $
anywhere in the command line but it does not work. I tried to, kind of, re-open the question & tried also the suggestion of following the above mentioned answer, kind of closely & putting the function in the .bashrc
file but it still does not work for me (& it seems is not the best (practice (I'm sorry))) so just hereby asking for some more help. I would appreciate it.
bash command-line dictionary
add a comment |
Hi I got interest in a solution posted here & put the suggested function in a bash script
leaving at ~/.bin
so, a dir
under path
. Then performed $chmod +x verbteacher.sh
for easy calling from $
anywhere in the command line but it does not work. I tried to, kind of, re-open the question & tried also the suggestion of following the above mentioned answer, kind of closely & putting the function in the .bashrc
file but it still does not work for me (& it seems is not the best (practice (I'm sorry))) so just hereby asking for some more help. I would appreciate it.
bash command-line dictionary
Have you re-sourced your.bashrc
and/or closed/reopened your terminal? If so what is the output of:declare -f verbteacher
. Also where did you hear it is not best practice to put functions in.bashrc
?
– Jesse_b
Apr 6 '18 at 20:23
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to$declare -f verbteacher
is:verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05
add a comment |
Hi I got interest in a solution posted here & put the suggested function in a bash script
leaving at ~/.bin
so, a dir
under path
. Then performed $chmod +x verbteacher.sh
for easy calling from $
anywhere in the command line but it does not work. I tried to, kind of, re-open the question & tried also the suggestion of following the above mentioned answer, kind of closely & putting the function in the .bashrc
file but it still does not work for me (& it seems is not the best (practice (I'm sorry))) so just hereby asking for some more help. I would appreciate it.
bash command-line dictionary
Hi I got interest in a solution posted here & put the suggested function in a bash script
leaving at ~/.bin
so, a dir
under path
. Then performed $chmod +x verbteacher.sh
for easy calling from $
anywhere in the command line but it does not work. I tried to, kind of, re-open the question & tried also the suggestion of following the above mentioned answer, kind of closely & putting the function in the .bashrc
file but it still does not work for me (& it seems is not the best (practice (I'm sorry))) so just hereby asking for some more help. I would appreciate it.
bash command-line dictionary
bash command-line dictionary
asked Apr 6 '18 at 20:18
RS. MontalvoRS. Montalvo
31
31
Have you re-sourced your.bashrc
and/or closed/reopened your terminal? If so what is the output of:declare -f verbteacher
. Also where did you hear it is not best practice to put functions in.bashrc
?
– Jesse_b
Apr 6 '18 at 20:23
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to$declare -f verbteacher
is:verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05
add a comment |
Have you re-sourced your.bashrc
and/or closed/reopened your terminal? If so what is the output of:declare -f verbteacher
. Also where did you hear it is not best practice to put functions in.bashrc
?
– Jesse_b
Apr 6 '18 at 20:23
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to$declare -f verbteacher
is:verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05
Have you re-sourced your
.bashrc
and/or closed/reopened your terminal? If so what is the output of: declare -f verbteacher
. Also where did you hear it is not best practice to put functions in .bashrc
?– Jesse_b
Apr 6 '18 at 20:23
Have you re-sourced your
.bashrc
and/or closed/reopened your terminal? If so what is the output of: declare -f verbteacher
. Also where did you hear it is not best practice to put functions in .bashrc
?– Jesse_b
Apr 6 '18 at 20:23
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to
$declare -f verbteacher
is: verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to
$declare -f verbteacher
is: verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05
add a comment |
3 Answers
3
active
oldest
votes
If you want the conjugations (on link address, after /conjugations/
you may choose the language you want to, in my case I choosed french /fra/
) values, write this on the last line of .bashrc
:
conjfra () {
curl -s "http://api.ultralingua.com/api/2.0/conjugations/fra/$1" | jq -r '. | {tense: .conjugations}'
}
Merci!
EDIT: My bad! sorry for that, I forgot to add the tab space onset on second line, now is correct.
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.
– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
add a comment |
The function (directly from that answer, with only minor modifications):
verbteacher () {
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" ;
}
This can be put into your .bashrc
file which would define it for any new shell started (not the current shell session).
You could also turn it into a script:
#!/bin/sh
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}"
This should be saved into a file that you make executable and put somewhere in a directory that is in your $PATH
.
Note: I have not looked carefully at what this code actually does. It may possibly be further improved. This answer is about the issue with just actually using the function provided.
add a comment |
I found an API that handles conjugations. I have created this function that will query it but it requires jq
. Also the output is rather verbose but I'm sure it can be pared down by someone that knows jq
better than me:
verbteacher () {
curl -s "http://api.ultralingua.com/api/conjugations/eng/$1" | jq '. | {tense: .partofspeech.tense, verb: .surfaceform}'
}
Usage:
$ verbteacher run
{
"tense": "infinitive",
"verb": "run"
}
{
"tense": "pastparticiple",
"verb": "run"
}
{
"tense": "presentparticiple",
"verb": "running"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "runs"
}
....
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%2f436072%2flooking-for-an-e-g-bash-solution-to-check-english-verb-conjugation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want the conjugations (on link address, after /conjugations/
you may choose the language you want to, in my case I choosed french /fra/
) values, write this on the last line of .bashrc
:
conjfra () {
curl -s "http://api.ultralingua.com/api/2.0/conjugations/fra/$1" | jq -r '. | {tense: .conjugations}'
}
Merci!
EDIT: My bad! sorry for that, I forgot to add the tab space onset on second line, now is correct.
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.
– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
add a comment |
If you want the conjugations (on link address, after /conjugations/
you may choose the language you want to, in my case I choosed french /fra/
) values, write this on the last line of .bashrc
:
conjfra () {
curl -s "http://api.ultralingua.com/api/2.0/conjugations/fra/$1" | jq -r '. | {tense: .conjugations}'
}
Merci!
EDIT: My bad! sorry for that, I forgot to add the tab space onset on second line, now is correct.
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.
– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
add a comment |
If you want the conjugations (on link address, after /conjugations/
you may choose the language you want to, in my case I choosed french /fra/
) values, write this on the last line of .bashrc
:
conjfra () {
curl -s "http://api.ultralingua.com/api/2.0/conjugations/fra/$1" | jq -r '. | {tense: .conjugations}'
}
Merci!
EDIT: My bad! sorry for that, I forgot to add the tab space onset on second line, now is correct.
If you want the conjugations (on link address, after /conjugations/
you may choose the language you want to, in my case I choosed french /fra/
) values, write this on the last line of .bashrc
:
conjfra () {
curl -s "http://api.ultralingua.com/api/2.0/conjugations/fra/$1" | jq -r '. | {tense: .conjugations}'
}
Merci!
EDIT: My bad! sorry for that, I forgot to add the tab space onset on second line, now is correct.
edited Jan 22 at 15:17
answered Jan 19 at 0:45
Mahanb HamanandaMahanb Hamananda
162
162
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.
– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
add a comment |
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.
– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:
parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.– RS. Montalvo
Jan 21 at 12:46
Thanks Mahanb Hamananda , I tried it but it should be sth missing as I only got as output:
parse error: Invalid numeric literal at line 1, column 10
Could you, please check it out?? I appreciate it.– RS. Montalvo
Jan 21 at 12:46
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
My bad! sorry for that, I forgot to add the tab space onset of second line, now is correct.
– Mahanb Hamananda
Jan 22 at 2:26
add a comment |
The function (directly from that answer, with only minor modifications):
verbteacher () {
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" ;
}
This can be put into your .bashrc
file which would define it for any new shell started (not the current shell session).
You could also turn it into a script:
#!/bin/sh
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}"
This should be saved into a file that you make executable and put somewhere in a directory that is in your $PATH
.
Note: I have not looked carefully at what this code actually does. It may possibly be further improved. This answer is about the issue with just actually using the function provided.
add a comment |
The function (directly from that answer, with only minor modifications):
verbteacher () {
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" ;
}
This can be put into your .bashrc
file which would define it for any new shell started (not the current shell session).
You could also turn it into a script:
#!/bin/sh
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}"
This should be saved into a file that you make executable and put somewhere in a directory that is in your $PATH
.
Note: I have not looked carefully at what this code actually does. It may possibly be further improved. This answer is about the issue with just actually using the function provided.
add a comment |
The function (directly from that answer, with only minor modifications):
verbteacher () {
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" ;
}
This can be put into your .bashrc
file which would define it for any new shell started (not the current shell session).
You could also turn it into a script:
#!/bin/sh
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}"
This should be saved into a file that you make executable and put somewhere in a directory that is in your $PATH
.
Note: I have not looked carefully at what this code actually does. It may possibly be further improved. This answer is about the issue with just actually using the function provided.
The function (directly from that answer, with only minor modifications):
verbteacher () {
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" ;
}
This can be put into your .bashrc
file which would define it for any new shell started (not the current shell session).
You could also turn it into a script:
#!/bin/sh
wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html |
sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}"
This should be saved into a file that you make executable and put somewhere in a directory that is in your $PATH
.
Note: I have not looked carefully at what this code actually does. It may possibly be further improved. This answer is about the issue with just actually using the function provided.
edited Apr 7 '18 at 7:49
answered Apr 6 '18 at 20:24
KusalanandaKusalananda
126k16239393
126k16239393
add a comment |
add a comment |
I found an API that handles conjugations. I have created this function that will query it but it requires jq
. Also the output is rather verbose but I'm sure it can be pared down by someone that knows jq
better than me:
verbteacher () {
curl -s "http://api.ultralingua.com/api/conjugations/eng/$1" | jq '. | {tense: .partofspeech.tense, verb: .surfaceform}'
}
Usage:
$ verbteacher run
{
"tense": "infinitive",
"verb": "run"
}
{
"tense": "pastparticiple",
"verb": "run"
}
{
"tense": "presentparticiple",
"verb": "running"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "runs"
}
....
add a comment |
I found an API that handles conjugations. I have created this function that will query it but it requires jq
. Also the output is rather verbose but I'm sure it can be pared down by someone that knows jq
better than me:
verbteacher () {
curl -s "http://api.ultralingua.com/api/conjugations/eng/$1" | jq '. | {tense: .partofspeech.tense, verb: .surfaceform}'
}
Usage:
$ verbteacher run
{
"tense": "infinitive",
"verb": "run"
}
{
"tense": "pastparticiple",
"verb": "run"
}
{
"tense": "presentparticiple",
"verb": "running"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "runs"
}
....
add a comment |
I found an API that handles conjugations. I have created this function that will query it but it requires jq
. Also the output is rather verbose but I'm sure it can be pared down by someone that knows jq
better than me:
verbteacher () {
curl -s "http://api.ultralingua.com/api/conjugations/eng/$1" | jq '. | {tense: .partofspeech.tense, verb: .surfaceform}'
}
Usage:
$ verbteacher run
{
"tense": "infinitive",
"verb": "run"
}
{
"tense": "pastparticiple",
"verb": "run"
}
{
"tense": "presentparticiple",
"verb": "running"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "runs"
}
....
I found an API that handles conjugations. I have created this function that will query it but it requires jq
. Also the output is rather verbose but I'm sure it can be pared down by someone that knows jq
better than me:
verbteacher () {
curl -s "http://api.ultralingua.com/api/conjugations/eng/$1" | jq '. | {tense: .partofspeech.tense, verb: .surfaceform}'
}
Usage:
$ verbteacher run
{
"tense": "infinitive",
"verb": "run"
}
{
"tense": "pastparticiple",
"verb": "run"
}
{
"tense": "presentparticiple",
"verb": "running"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "run"
}
{
"tense": "present",
"verb": "runs"
}
....
answered Apr 6 '18 at 22:53
Jesse_bJesse_b
12.3k23065
12.3k23065
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%2f436072%2flooking-for-an-e-g-bash-solution-to-check-english-verb-conjugation%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
Have you re-sourced your
.bashrc
and/or closed/reopened your terminal? If so what is the output of:declare -f verbteacher
. Also where did you hear it is not best practice to put functions in.bashrc
?– Jesse_b
Apr 6 '18 at 20:23
The question you have referenced is 6 years old and was scraping a website - even translating that function into a shell script is unlikely to give you the results you are looking for, as html-scraping is incredibly fragile.
– cunninghamp3
Apr 6 '18 at 20:33
Yes @Jesse_b, thanks. I closed/reopened terminal & did also those little modifications suggested by @kusalananda but still (it doesn't work for me). The output I got to
$declare -f verbteacher
is:verbteacher () { wget -qO - http://conjugator.reverso.net/conjugation-english-verb-"$1".html | sed -n "/>Preterite|>Past</{s@<[^>]*>@ @g;s/s+/ /g;/e I/s/.* I ([^ ]*) you .*/Simple past: 1/;/ Past/s/ Past /Past participle: /;p}" }
– RS. Montalvo
Apr 7 '18 at 1:05