Hacker News article HackerNews user “sirwinder” found a way to run commands without leaving a line of text.
He writes:When I want to run everything in a terminal I use command line and then type:And when I want it to run automatically in the background I use:But what does this mean?
If I want a command to work in my terminal and not in a command line I can just type:But if I want my command to be executed automatically in a background and not run in the terminal I can type:Then when I have everything set up correctly, I can use:So what do I need to do to automate my workflows?
The short answer is that you don’t need to have all the commands set up manually.
You just need to be able to see them in your current working directory and you can add them to a list in a few different ways.
First, you can put your commands in a list called commands and then add them by typing the following command:You can also add a command from a file using the following:Then you can set up multiple command aliases by using the command line tool to add or remove them as you need them:For example, if I wanted to run a command in the command prompt using the alias:If you are having trouble seeing these commands in your working directory, try the following steps.
First open a command prompt window and add the following lines to your .bashrc file:Then run:$ cd /usr/local/bin/gpg-agent -tsecret $gpg –keysecret [email protected] you should see this:You have added a key and password to the keychain of your account and the secret key you just created is being used to authenticate to the service.
Next, add a list to your ~/.bashrc:Then add the command below the first line of the file:And then add the commands from the file above to your list of commands:Next, change the order in which your commands are displayed in your command prompt:And finally, add the list of all the aliases you have created to your $HOME/.bashrc :And finally run:If your command line interface still doesn’t work, you might want to change the default behavior of the commands that you run to one that does.
First change the name of your alias to alias:You will be asked to enter your password to confirm the changes.
Next change the command that is used to run the command.
Run the following commands in the order that they appear in your .profile file:First run: $ alias set $gid=$gid$password$alias $gidsockuppassword $gipid $gpass $password$gpgsecret $secret$gipadd $password $alias$gidNext run: You will be prompted to enter the passphrase.
Type the following to change your password:$ alias set pass $galt $passwordTo change the alias for a command that you want run, change its name.
To add a new command to your alias, enter its name:Then enter the command you want.
To delete a command, enter the name for the command as well:Then type the following, then hit Enter.
This will delete the command from your alias.
To rename a command or alias, type its name as well and hit Enter:To remove a command/alias, type it’s name and hit Delete:To run a different command/ alias, press Ctrl+X, then enter the new command or aliases name.
Press Enter to close your .shrc file and save your changes.
You now have the ability to automate tasks that are not in your default workflow.
If you would like to see how to automate any of these tasks, try using the GPG plugin.