Here are several different ways to test a TCP port without telnet.
BASH (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
| gem install --http-proxy http://user:[email protected]:8080 bundler |
Here are several different ways to test a TCP port without telnet.
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
| var credential = "YOUR-APP-CONFIGURATION-CREDENTIAL-ID"; | |
| var secret = "YOUR-APP-CONFIGURATION-CREDENTIAL-VALUE"; | |
| function signRequest(host, | |
| method, // GET, PUT, POST, DELETE | |
| url, // path+query | |
| body, // request body (undefined of none) | |
| credential, // access key id | |
| secret) // access key value (base64 encoded) | |
| { |
| #!/bin/bash | |
| ## Get the list of all the projects from Bitbucket account across all the pages | |
| get_total_project_list () { | |
| start=0 | |
| total_project_list=() | |
| is_last_page=false | |
| while ! $is_last_page | |
| do | |
| response=$(curl -k -u $u -X GET -H "Content-type: application/json" $bitbucket_url/rest/api/1.0/projects?start=$start) 2>&1 |