Question: I'm looking for a tool for displaying inline menus in the shell which can be navigated with arrow-keys and enter. By "inline", I mean that the menu is displayed within the normal flow of stdout text, *not* in a pop-up dialog on top of everything.

I only found [that post](https://unix.stackexchange.com/questions/146570/arrow-key-enter-menu) trying to address that, but it only mentions either custom scripting or non-inline/pop-up solutions (like `dialog` or `zenity`).

What I am looking for is a robust package that I could simply install within a Docker image using `apt-get` or `npm install -g` and invoke from my scripts with a list of choices and get back the user's selected item.

In nodeJS, I am using [Inquirer](https://www.npmjs.com/package/inquirer) which offers not only that kind of menus, but also all sorts of inputs.

Here's an example [screenshot](https://i.imgur.com/P1qGjQe.png) of such an inline menu.

The tool does not have to be written in shell script. It can be a binary/script written in any language, as long as it's rather easy to install using `apt-get`/`curl`. Even a nodeJS tool would be fine, as long as it's invokable from a shell script to pass it the choices.

Answer: 
You could use `xargs` and start a small shell script:

```
jq -r '.href, .filename' file.json | xargs -n2 sh -c 'wget "$1" -O "$2"' sh

```

Note that `wget`'s `-o` option is for the logfile and `-O` is for the "output document".
I don't know about a jq-splitter on Linux, but you can use sed to split the fields, reading the output into variables and then run the wget thereafter. 

```
$> read HREF FILENAME < <(sed -r 's/(.*href:[ ]*)([^, ]*)(.*filename:[ ]*)([^, ]*)(.*)$/\2 \4/' files.json);wget "${HREF}" -o "${FILENAME}.pdf"

```

The `sed` uses the `-r` option to turn on regular expressions, creating capture groups to parse everything up to href, then gets its value. Then grabs everything up to filename and gets its value. printing a space separated output of capture groups 1 and 4. 

The values are read into `HREF` and `FILENAME`, then a semi-colon starts a separate command to run wget with the stored values.