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 <command> and <option> to the output of what i type next?

  • tofubl
    link
    fedilink
    English
    arrow-up
    6
    ·
    9 个月前

    Not 100% clear what you want to achieve, but you probably want an alias.

    • Telorand@reddthat.com
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      9 个月前

      They’d have to make an alias for every Pokemon. What they need is a simple program that reads input and executes the krabby command with that input as a parameter, then make it loop until it gets an exit command (or just Ctrl+C).

      • myfavouritename@beehaw.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 个月前

        No, I don’t think they’d have to make an alias for every Pokemon. The person you’re responding to is correct.

        Assuming that the original poster wants to continue to specify which Pokemon they want to see, they’ll at least have to type that in, right?

        If we’re comfortable with that as a requirement, then an alias setting “k” to equal “krabby name” will work when you enter any Pokemon name after “k”.

        • Telorand@reddthat.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          9 个月前

          I suppose that’s true, though with their vague requirements, I was imagining something more like a REPL, so they could enter as many Pokemon as they wanted in a row, without needing an alias every time.

    • heavydust@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 个月前

      My bash is rusty but I guess it would be alias k=krabby name to be able to type k pikachu

      Last but not least, make sure that k does not exist on your shell by typing k or which k before replacing it.