Need a script to add mutiple printers in solaris box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need a script to add mutiple printers in solaris box
# 1  
Old 07-30-2012
MySQL Need a script to add mutiple printers in solaris box

Hi ,

i need to configure around 80 printers in a server. can someone please help me with the script.
i have a file that has printer name and its ip.

like.

Code:
 
printer1 1.1.1.1
printer2 0.0.0.0

and so on.. can some one please help me to do it via script.
i am using solaris 10

After lot of thinking i could figure out the below script Smilie

Code:
j=1;
for i in `cat prntlist`
do
ipaddr=`awk -v a=$j '(NR==a){print $1}' iplist`
echo $i:$ipaddr
###i can add lpadmin cmd here with $i for printername and $ipaddr for printer ip
j=$((j+1))
done

i know with unix there would be many ways to do. If someone has some smarter way to do it then please let me know. Smilie

Thank you

Last edited by chidori; 07-30-2012 at 06:03 PM.. Reason: got one solution
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Notify when the script run(hourly)on my jump-box only when there is a failure on my remote-box

Team, Presently I have a script, which i have set up cron on one of my Jump-boxes,and gives me the output on every hourly basis,fetching the data from the remote machine.Basically it gives me the list of all active users logged and its count once we execute the script.Here the count is... (6 Replies)
Discussion started by: whizkidash
6 Replies

2. Shell Programming and Scripting

Problem with a script on a solaris 10 box

Hi Gurus I have several SAN's in two different locations. I collect performance data and archive them. In one location the archiving script runs on a solaris 9 server and in the other on a solaris 10 server. But the script fails every day on the solaris 10 server with this mes6=`/usr/bin/du -sk... (5 Replies)
Discussion started by: gnom
5 Replies

3. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

4. Shell Programming and Scripting

sftp script needed for solaris box

Hi , I have a solaris box through which i need to connect to ATM's and pull files using sftp. I did same type of scripting using ftp before but no sftp.The problem now i am facing is, i want to put the password along with this sftp (non-interactive) script. Unfortunately there is no... (3 Replies)
Discussion started by: Renjesh
3 Replies

5. Solaris

Problem defining remote printers on solaris 10

Good morning, I have a server with solaris 10 that I want to intall remote printers. I started lpsched deamon without problems with command: svcadm enable application/print/server I want to install printers that are defined locally on print server, so: lpadmin -p <device> -s <print... (2 Replies)
Discussion started by: bonovox
2 Replies

6. Solaris

Need to copy printers from Sol8 box to Sol10 box-No luck so far

I need to copy the printers currently installed on a Sol8 box to a Sol10 box. I tried copying the printers.conf file from the Sol8 box and that worked until I went through the file and changed the server name to that of the Sol10 box. Another post on this forum suggested copying the entire... (1 Reply)
Discussion started by: todis
1 Replies

7. Shell Programming and Scripting

Box A's perl script calling box B's shell script

Hi all, i have a perl script one server. I am running a cronjob to execute my perl script. #! /usr/bin/perl ... ... ... #call a shell script on another server How can i accomplish #? Do i have to issue a system (" ssh -l username server | shellscript.sh") in my shell script? or is there a... (1 Reply)
Discussion started by: new2ss
1 Replies

8. UNIX for Dummies Questions & Answers

difference between AIX box and Sun Solaris box

Hi, I need a clarification. Is there any difference between AIX box and Sun Solaris box? The bzip command with -c option works in AIX box and the same does not work in Sun Solaris box. Can anyone please explain if there is an implementation difference in both these boxes for the shell... (1 Reply)
Discussion started by: nisha4680
1 Replies

9. Shell Programming and Scripting

Script to Reboot a linux box from a windows box

HI All, I need a script to reboot a linux box from a windows box. The script needs to run automatically whenever a sitescope alerts with an error message. Have searched for this in the forums, but could not get something relative. Pls. let me know the various alternatives we have to do... (2 Replies)
Discussion started by: Crazy_murli
2 Replies

10. UNIX for Dummies Questions & Answers

Solaris and NT/Win2k HP Printers Help

I'm currently trying to setup a Solaris machine to use a couple of HP printers. The printers are connected using jetdirect to printservers ( 1 NT and 1 Win2k). I've tried adding access using the admintool but when I try and print the print fails with the error msg : error transferring print job.... (6 Replies)
Discussion started by: ianf
6 Replies
Login or Register to Ask a Question