![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with the 2 for loops | vadharah | Shell Programming and Scripting | 1 | 03-04-2008 01:26 PM |
| Help with While Loops | MaestroRage | UNIX for Dummies Questions & Answers | 1 | 02-12-2008 11:04 PM |
| while loops | nymus7 | Shell Programming and Scripting | 4 | 03-31-2006 09:59 AM |
| While loops and awk | Loriel | Shell Programming and Scripting | 1 | 10-26-2005 09:26 AM |
| no more loops | tony3101 | Shell Programming and Scripting | 5 | 06-09-2004 11:01 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ksh question, loops
i want to add about 60 printers using a ksh script.
i am having trouble though, i am reading the input from the hosts file and using the lpadmin command to add like so: lpadmin -p [printername] -v /dev/null -m netstandard -o dest=[ipaddy] i want printername and ipaddy to come from the hosts file, i am having some trouble getting the right variables in the right spots, i know this is about a 2 minute script for some of you, so any assistance will be greatly appreciated. thanks, Brian |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
assuming /etc/host file format:
Code:
#!/bin/ksh
while read ip host junk
do
lpadmin -p "${host}" -v /dev/null -m netstandard -o dest="${ip}"
done < myPrinterFile
|
||||
| Google The UNIX and Linux Forums |