Bu Blogda Ara

Yükleniyor...

23 Ekim 2012 Salı

How to add nameservers in Ubuntu


Ubuntu (I dont exactly know on which version  its started to do so ) overwrites manual changes made to resolv.conf. Here is what you can
sudo vi /etc/resolvconf/resolv.conf.d/tail
 Enter the below nameservers:
nameserver 10.34.34.221
nameserver 10.34.34.222
and run
resolvconf -u
Done.

23 Eylül 2012 Pazar

while IFS='|' read -r

I really fancy the performance achieved while reading a stream line by line using file separator IFS and read -r option. For example assume you have a phone list like the below:

NAME SURNAME PHONE
john|smith|+44.............
ali|veli|+90..........

...

carlos|suarez|+34..............

You can process the file with the below script line by line having name surname and phone numbers separated.

cat phonelist | while IFS="|" read -r V1 V2 V3; do echo "Name:$V1 Surname:$V2 Phone:$V3";done

Its really fast compared to reading line by line and using awk for processing the lines.