Script only processes 1st Line of input file

Script only processes 1st Line of input file

bash script to read a file and process commands remotely. It currently only processes the first line (server1)

bash script to read a file and process commands remotely. It currently only processes the first line (server1)

Need to remotely process 3 commands on server1 , then server2 ......

#!/bin/bash

while read line; do sshpass -f password ssh -o StrictHostKeyChecking=no [email protected]$line zgrep "^A30=" /var/tmp/logs1/messages.* | >> Output.txt sshpass -f password ssh -o StrictHostKeyChecking=no [email protected]$line zgrep "^A30=" /var/tmp/logs2/messages.* | >> Output.txt sshpass -f password ssh -o StrictHostKeyChecking=no [email protected]$line zgrep "^A30=" /var/tmp/logs3/messages.* | >> Output.txt done < file1

file1:

server1
server2
server3


bash linux

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Dedicated Linux Developer

Looking to develop real-time applications? **[Hire Dedicated Linux Developer](https://hourlydeveloper.io/hire-dedicated-linux-developer/ "Hire Dedicated Linux Developer")** from **[HourlyDeveloper.io](https://hourlydeveloper.io/...

User Administration in Linux - Linux Tutorial - Linux Training

User Administration in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

Package Management in Linux - Linux Tutorial - Linux Training

How to install bash shell in Alpine Linux

This page explains how to install bash shell in Alpine Linux using the apk command line options including setting up command-line tab-completion for bash.The postmarketOS project, which is designed to run on mobile devices, is based on Alpine Linux. Many Docker images are also based upon Alpine, and you may install bash shell in Docker-based images too.

Linux Sleep Command (Pause a Bash Script)

sleep is a command-line utility that allows you to suspends the calling process for a specified time. In other words, the sleep command pauses the execution of the next command for a given number of seconds. The sleep command is useful when used within a bash shell script, for example, when retrying a failed operation or inside a loop. In this tutorial, we will show you how to use the Linux sleep command.