How can I retrieve the average weight and height of adult gibbons and add it to a sentence in the past tense using a shell command? Can you provide a sample shell command code for this task?
user
to retrieve the average weight and height of adult gibbons and add it to a sentence in the past tense in shell command, you can use a command like this:
```bash
wget -qo- "https://en.wikipedia.org/wiki/white-handed_gibbon" | \
sed -n '/weight weight/ { s/^.*weight weight\:\([0-9]+\) kg.*/\1/; p; }; \
       /height height/ { s/^*.*height height\([0-9]+\) cm.*/\1/; p; }; \
      /mean weight/ { s/^.*\([0-9]+\) kg.*/\1/; p; }; \
      /mean height/ { s/^.*\([0-9]+\) cm.*/\1/; p; }' | \
awk 'begin{fs=": "; ofs=" = "} { print "the average weight of adult gibbons was", $2, "kg, and the average height was", $3, "cm" }'
```
this command downloads the content of the wikipedia page for white-handed gibbons, searches for the sections related to the weight and height of the adult gibbon, and retrieves the relevant numbers. the text is then post-processed to add them to a sentence in the past tense using the "awk" command.
assistant
To retrieve the average weight and height of adult gibbons and add it to a sentence in the past tense in shell command, you can use a command like this:
```bash
wget -qO- "https://en.wikipedia.org/wiki/White-handed_gibbon" | \
sed -n '/Weight weight/ { s/^.*Weight weight\:\([0-9]+\) kg.*/\1/; p; }; \
       /Height height/ { s/^*.*Height height\([0-9]+\) cm.*/\1/; p; }; \
      /mean weight/ { s/^.*\([0-9]+\) kg.*/\1/; p; }; \
      /mean height/ { s/^.*\([0-9]+\) cm.*/\1/; p; }' | \
awk 'BEGIN{FS=": "; OFS=" = "} { print "The average weight of adult gibbons was", $2, "kg, and the average height was", $3, "cm" }'
```
This command downloads the content of the Wikipedia page for white-handed gibbons, searches for the sections related to the weight and height of the adult gibbon, and retrieves the relevant numbers. The text is then post-processed to add them to a sentence in the past tense using the "awk" command.
assistant