Sponsored Content
Full Discussion: Variable from a text file
Top Forums Shell Programming and Scripting Variable from a text file Post 302422720 by ggoliath on Wednesday 19th of May 2010 08:03:05 AM
Old 05-19-2010
Ok thanks, that works BUT
BUT its not adding the printer with other three variables as specified in the lpadmin statement
Code:
$BIN/lpadmin -p "$P" -E -D "$drv"://"$IP":"$port"

here is the script being run
Code:
+ echo \n\t Adding printers 5001x02 !!!!
         Adding printers 5001x02 !!!!
+ /usr/lbin/lpadmin -p 5001x02 -E -D lpd
socket
socket
lpd
lpd
lpd://172.25.29.60
172.25.44.188
172.25.11.170
172.25.11.203
172.25.12.160
172.25.12.160:515
9100
9100
515
515
515
+ echo \n\t Printer  created


If i do a lpstat -v (which displays printer)
it does not give me the required details
Code:
lpstat -v 5001x02
device for 5001x02: ///dev/null

WHERE IS THE $drv,$IP and the $PORT
Is there something amiss
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text file to a variable

I have a variable which is not being populated with the contents of a text file, and I'm wondering if anyone happens to know how to do this for a sh type script? #!/bin/sh set alertperson = cat /export/home/bdodym/alert.person if then cat /export/home/bdodym/callout6.msg |... (6 Replies)
Discussion started by: tjhorwood
6 Replies

2. UNIX for Dummies Questions & Answers

Assigning value in a text file to a variable

Hi, I need to place a number located in a text file in a variable so I can perform if/then comparison. How would I go about doing this? Using A=awk '{print $2}' maintenance_date.tmp does not seem to work. Thanks (1 Reply)
Discussion started by: mojoman
1 Replies

3. UNIX for Dummies Questions & Answers

Searching a text file and assigning it to a variable

Hi Gurus, I am new to unix.I have a requirement as below I have text file like a.txt which contains a.txt hi hello process update status Ok to Proceed no issues good data arrangement My requirement here is i need to read the file and check for the words "OK to Proceed" and if... (2 Replies)
Discussion started by: pssandeep
2 Replies

4. Shell Programming and Scripting

Replace variable names in text file with its value

Hi I have a text file (mytext.txt), the content of which is as following: My name is <@MY_NAME@> and my age is <@MY_AGE@> . Now i have another property file (myprops) which is as following: MY_NAME=abcdefgh MY_AGE=000000 I was wondering, how can i replace the tags of mytext.txt, with its... (1 Reply)
Discussion started by: vigithvg
1 Replies

5. Shell Programming and Scripting

Assigning a value as a variable from a text file

I have a txt file output.txt Freq = 1900 L = 159I want to assign the values to a variable so that i can further use it in some other script. like F=1900 Len=159 etc i tried doing something with awk but dosent work F=$(awk 'BEGIN {}/Freq/ {split ($2,a);depth=a};printf "%d\t,... (2 Replies)
Discussion started by: shashi792
2 Replies

6. Shell Programming and Scripting

replace text in file using variable

Hi, I'm making a script that automaticaly set file size and path in xml file. I tried with : sed -i 's/BOOTPATH/TEST/g' file.xml it works fine but if I use a viriable : sed -i 's/BOOTPATH/$bootpathf/g' file.xml with this one, no change are made. I don't understand why. If a make a ... (13 Replies)
Discussion started by: Toug
13 Replies

7. Shell Programming and Scripting

Defined Variable from text file

Hi Guys, I have one text file ABC.txt...It have 3 lines List=/home/klk/dir/ABC.txt Leajnk123 KJUHIO1234 IJOKIJ7676 I want use as different variable of each line.Just like X=firstline Y=Secound Line Z=Third Line (4 Replies)
Discussion started by: asavaliya
4 Replies

8. Shell Programming and Scripting

Read a file name from a text file and save it in a variable

i have a text file consists of different file names like: line 1: lib/libIMb.so message broker file line 2: lil/imbdfg.lil message broker file i need to extract libIMb.so and imbdfg.lil files from those lines and save them in a variable. so that i can search for... (9 Replies)
Discussion started by: santosh2626
9 Replies

9. UNIX for Dummies Questions & Answers

[Help] Adding text to a variable line in a file

Hey guys, I need to write a script that will add a specific text at the end of a specific line (of a text file). but the line is a variable this is my text file : device_2 ansible_ssh_host=127.0.0.1 ansible_ssh_port=30000 ansible_ssh_user='root' device_2 ansible_ssh_host=127.0.0.1... (1 Reply)
Discussion started by: OdedOvdat
1 Replies

10. Shell Programming and Scripting

Extract text from file then write variable

I have a text file that has many lines, and for each line I need to extract different sections of text, then write several variables from the data. I can split out the various sections by selecting their position on each line as the column sizes will never vary. A sample of my text file is below... (2 Replies)
Discussion started by: kcpoole
2 Replies
in.lpd(1M)						  System Administration Commands						in.lpd(1M)

NAME
in.lpd - BSD print protocol adaptor SYNOPSIS
/usr/lib/print/in.lpd DESCRIPTION
in.lpd implements the network listening service for the BSD print protocol specified in RFC 1179. The BSD print protocol provides a remote interface for systems to interact with a local spooling system. The protocol defines five standard requests from the client to the server: starting queue processing, transferring print jobs, retrieving terse status, retrieving verbose status, and canceling print jobs. The in.lpd service is managed by the service management facility, smf(5), under the service identifier: svc:/network/lp Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). Responsibil- ity for initiating and restarting this service is delegated to inetd(1M). Use inetadm(1M) to make configuration changes and to view config- uration information for this service. The service's status can be queried using the svcs(1) command. in.lpd uses the config/log_from_remote property to allow or disallow remote access. The default value of this property, localhost, disal- lows remote access. inetd waits for connections on TCP port 515. Upon receipt of a connect request, in.lpd is started to service the connection. Once the request has been filled, in.lpd closes the connection and exits. EXAMPLES
Example 1 Allowing Remote Access The following command allows remote access to in.lpd. # inetadm -m svc:/application/print/rfc1179:default bind_addr="" EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. FILES
/etc/printers.conf System printer configuration database. printers.conf.byname NIS version of /etc/printers.conf. printers.org_dir NIS+ version of /etc/printers.conf. /usr/lib/print/bsd-adaptor/bsd_*.so* Spooler translation modules. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpcu | +-----------------------------+-----------------------------+ SEE ALSO
svcs(1), inetadm(1M), inetd(1M), svcadm(1M), printers.conf(4), attributes(5), smf(5) SunOS 5.11 1 Aug 2006 in.lpd(1M)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy