0

Is there a way in PuTTY to run a script that will read a file of names and then answer a prompt of yes (per name)?

It is a Red Hat Linux backend server that I am connecting too.

At times I can get a list of over 100 names, and I have to do them one by one.

In batch it may be something like below for /F "tokens=*" %%A in (myfile.txt) do [process] %%A echo y

or maybe in shell #!/bin/bash

 input_file=server.csv

echo "ServerName"

tail -n +2 "$input_file" | while IFS=, read -r server name _ do if acli snapshot.delete -c 3 "$ServerName" > /dev/null; then echo Y

else
    server_delete="FAIL"

done

Giacomo1968
  • 58,727

0 Answers0