this post was submitted on 06 Apr 2025
19 points (100.0% liked)

Linux Questions

1569 readers
1 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS
 

i'm trying to basically make a shortcut for krabby (see link) so i dont have to type <krabby name (pokemon name)> to see a specified pokemon. basically how can i make a script that passes the and to the output of what i type next?

you are viewing a single comment's thread
view the rest of the comments
[–] couch1potato@lemmy.dbzer0.com 2 points 1 day ago (1 children)

You said see link but there's no link

[–] HotsauceHurricane@lemmy.one 2 points 1 day ago (1 children)

Still not clear what you're trying to do but assuming you're trying to manipulate the krabby output with a different program, the other poster's link on aliases should help you out. See the bottom section there on bash functions.

So for example if you're trying to store a krabby output to a specific folder, something like this:

alias_name () { mkdir /path/%1 && krabby name %1 | xargs mv -t /path/%1 }

So in theory, typing something like alias_name charizard would, in this order, create a new folder at /path/charizard, run krabby charizard, and then place the output charizard file inside your new /path/charizard folder.

I say in theory because I don't know what output krabby gives you and I don't know bash, I just googled how piping with xargs works right now. But maybe with this idea you can figure it out.