upvote
This really makes me think of A Deepness in the Sky by Vernor Vinge. A loose prequel to A Fire Upon The Deep, and IMO actually the superior story. It plays in the far future of humanity.

In part of it, one group tries to take control of a huge ship from another group. They in part do this by trying to bypass all the cybersecurity. But in those far future days, you don't interface with all the aeons of layers of command protocols anymore, you just query an AI who does it for you. So, this group has a few tech guys that try the bypass by using the old command protocols directly (in a way the same thing like the iOS exploit that used a vulnerability in a PostScript font library from 90s).

Imagine being used to LLM prompting + responses, and suddenly you have to deal with something like

  sed '/^```/d;/^#/d;s/^[[:space:]]\*//;/^$/d' | head -1); [[ $r ]]
and generally obtuse terminal output and man pages.

:)

(offtopic: name your variables, don't do local x c r a;. Readability is king, and a few hundred thousand years from now some poor Qeng Ho fellow might thank his lucky stars you did).

reply
What is the AI doing here? Or is this just like being cheeky?
reply
The pile of shell and sed is cleaning up the ai output and then running it in the shell.

The instruction to the AI was to create _a_ shell command. So it's a random shell command generator (maybe).

reply
that part is the system prompt, the script is a function that takes a prompt describing a shell command as an argument
reply
But it's gotta be just a joke right? Which is why all the examples are just classic things you do with bash/unix utilities?

I'll just say, if not a joke, the bit is appreciated either way!

"AI change to the home directory. Make it snappy!"

reply