0

i have 10 IP which have been listed on a CSV or text file , i need to read each time one line and get the IP and set on eth0 interface of the server, i found the bellow script which some how show me how to create new network setting but i do not know how i could read one line from CSV and put it on variable to use with bellow script . i would be greatly thankful if you give me some hint , thanks

https://wiki.gogrid.com/index.php/Customer:Automatically_convert_your_Linux_server_to_a_static_IP

1 Answers1

0

May something like this:

#!/bin/sh

lineNumber=1
ip=`head -n $lineNumber test.csv | tail -n 1 | line`
echo $ip
Murad Tagirov
  • 776
  • 6
  • 10