Skip to content

Is there a way to invoke a command from another command? #522

Answered by DannyBen
dragonfleas asked this question in Q&A
Discussion options

You must be logged in to vote

I see the code in the commands as a simple, "dumb" controller code. So my short recommendation is this:
If you have code that you need to run in multiple places, create a lib function for it, and call it from multiple places.
I recommend avoiding calling one command from another.

However, if you really want to, you can call the other command as you call any other bash command - meaning, invoke your script (assuming you know it is installed in the PATH).

This was asked here and answered with more details here.

If you feel that none of these sit right, and wish to propose another approach - I am open to further discussion.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dragonfleas
Comment options

@DannyBen
Comment options

Answer selected by dragonfleas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants