Simple Script

This morning I could not for the life of me remember how to read two variables from on line in bash. As a result I am putting this simple script up here.

The listing of printer IP addresses is in the file /tmp/printers.txt and looks like this.

cat /tmp/printers.txt = = =

# 2010-08-24 Jud Bishop
# Simple script to find names of local and remote printers
# that are translated.

while IFS== read remote local  
        name=`dig +short -x $local`
        echo -e "$name,$remote,$local"
done < /tmp/printers.txt, ,, ,, ,

./ | sed 's/\.//3 
s/\ //g'
This entry was posted in Code, Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s