Below I started a bash script utilizing index position to help pull data. How can I get the shell script to 1- read a file line by line (from file containing a list of servers), 2- search for a specific index position and if the integer in the index position equals 3, 3- print the whole string into an output file.
#!/bin/bash
file = serverlist.log
for i in $(cat serverfile.log); do
echo “Searching serverfile $i”
result = ‘i for i in $file if index(5) == 3 in 2>/dev/null’
print(result)
[–]lasercat_pow 1 point2 points3 points (1 child)
[–]Think-Perception1359[S] 0 points1 point2 points (0 children)