DEV Community

Discussion on: Bash script for testing logging on

Collapse
 
rpalo profile image
Ryan Palo

Hi there! Welcome to the community! I found this answer to a similar question on StackOverflow. I tested it out and it seems to work well as long as you use an ssh key that doesn't have a passphrase on it.

On a DEV tips note:

  1. You can use triple backticks with a programming language to get syntax highlighting:

Using syntax highlighting markdown features.

This yields:

#!/bin/bash

for host in $( cat servers.txt ); do
    ssh # ...
done > test.log
Enter fullscreen mode Exit fullscreen mode
  1. You can use the help tag on your articles to have it featured in section of the site specifically for asking questions and getting help.

#help

A place to ask questions and provide answers. We're here to work things out together.

Let me know if this helps!