The sub program I used several years ago

Several years ago, I find a friend use this tool on his working, and I also setup the tool on my env, but I forget how to install it.

After search on the github with text in the bash file, I finally find the tool, which is called sub, I just save it here, so I can find it easily next time if I forget how to install it, hope you will enjoy with the tool too.

Installation

The following command is I installed on my environment, I named to tool wd, and place it on ~/tools .cd ~/tools
git clone https://github.com/qrush/sub wd
cd wd
./prepare.sh wd
# Then do as the prepare.sh's suggestion to setup environment

Add sub command

I use this tool to connect to the servers, for example, I have two server, one is for test, and another is for prod, then I can create two files in ~/tools/wd/libexec .touch wd-test
touch wd-prod
chmod +x wd-test wd-prod# content of wd-test
#!/usr/bin/env bash
# Usage: Connect to the test server
# Summary: Connect to the test server
# Help: This command will connect to the test serverssh -p <port> <user>@<host># content of wd-prod
# The content is similar with wd-test

Connect server with sub

Because I name the tool as wd , so I can connect server with the following commands:# Connect to the test server
wd test# Connect to the prod server
wd prod