[SOLVED] need to make a macro (or script) for bash
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running Linux-Lite 4.2 the shell is bash.
I need to make a macro, or perhaps its called a script, to allow me to enter "python3.7 app.py" into terminal when I press a key combination.
I tried installing a program called autokey. I tried installing it several different ways but I keep getting errors when trying to run it.
I can't find any other program that inserts a line of pre-written text when pressing a key combination. I can't put the line of text in clipboard and paste because I am already doing that constantly for another part of this process (hard to explain).
Point is, since I only need to insert this text into bash, is there a way bash can be setup to perform this macro?
Otherwise does anyone know of an alternative to autokey?
thank you, I never knew about this thing called alias. I did alias a='python3.7 app.py' so I just hit a and enter. It's one of those super repetitive tasks where I am doing this over and over for hours (again, it's hard to explain what I am actually doing). and when i close terminal the alias disappears (which is good, I only need the alias for this one task). I'll look into modifying the .bashrc if I ever need to make a perma alias. Anyhow, thank you, how do I mark this post as solved?
if you just add that to your .bashrc file which ever terminal you open it is there at your disposal.
marked solved in the top of your post there is a link saying marked solved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.