Return the last argument in the query?

I was wondering if there was a way for me to return/retrieve the last argument in a query? Similarly to how $(1-9) works, so if someone said:
Hello how are you?
The command would pick “you?” from that query.

Thanks in advance!

You could use eval to accomplish this like so:

!commands add !last $(eval a='$(query)'.split(' '); a[a.length - 1];)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.