Question: is there a way to have an alias execute multiple commands?
See original GitHub issueJust curious if there is a way to do this. I didn’t see anything in the docs, so …
Let’s say I have a couple of commands defined: a and b. If I want to define an alias to perform both of these command with an alias, how would I do that?
alias create c a;b or something like that (this doesn’t work, btw, or didn’t for me), hence, the question. Is there a way to do this?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How can I define a bash alias as a sequence of multiple ...
I.e say I want one command to change to a particular directory, then run another command. In addition, is there a way to...
Read more >Create a bash alias for several commands, some requiring ...
Save this answer. Save the file, then run exec bash from the terminal. The first alias is your command, the second alias allows...
Read more >Using multiple alias in a single command
This is possible in bash: if the last character of an alias definition is a space (or tab), then bash will unalias the...
Read more >Bash Aliases for Beginners
Aliases allow you to write shorter versions of commands that you use often. This means that you don't have to write the long-form...
Read more >1 alias 2 commands 1 argument - The UNIX and Linux Forums
1 · Passing an argument using alias to piped command · alias pipe, shell scripts · hagaysp and has been viewed 961 times....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@legacy-code Good luck with your project. Glad you are enjoying cmd2. I’ll close this now.
@tleonhardt Thanks so much. This has given me some additional thought on what to add to my app.
Currently, the
run_scripthandles what I need. The only down side is it needs to create a file to execute from, and that’s not bad at all, just sort of inconvenient at worst.Thanks for the thoughts on using
runcmds_plus_hooks- I might give that a go as well. It all depends on how much time I have and how much I need it to work! 😃I think this issue can be closed. Thanks again for the input and ideas.