10-10-2011
Quote:
Originally Posted by
rangarasan
Hi,
It will print "var is TEST".
if ur input file have three lines then it will print three times..
Cheers,
Ranga
Yep
. Please explain why
.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
/oracle/ID1/saparch"|awk '{print $2}'
what does print $2 means? (1 Reply)
Discussion started by: yls177
1 Replies
2. Shell Programming and Scripting
The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }'
I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ".
Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies
3. Shell Programming and Scripting
Hi
What is the correct syntax for use a variable value within a print sentence :
Example:
VAR1=$1
VAR2=$2
ls -l $VAR2/*.LOG | grep -v $VAR1 | nawk -F " " '{ print "mv "$9 " /backup/BACKUP/backup_db_type/$VAR1_arch/."}' > move_arch_des.sh
Is this case i need to print $VAR1 within... (3 Replies)
Discussion started by: osymad
3 Replies
4. Shell Programming and Scripting
Hello I have a log file like so
2009-01-15 17:55:06 H=host-216-153-217-114.spr.choiceone.net :30675 I=:25 F=<> rejected RCPT <feast@test.co.uk>: DNSBL listed at sbl-xbl.spamhaus.org
What I am trying to do is be able to print x amount of columns after a certain part of the line say F=
grep... (1 Reply)
Discussion started by: casseyjon
1 Replies
5. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
6. Shell Programming and Scripting
Hi friends I need one help from you .
I want to print name='JACK' through . how can i make it .
awk '{print "name=jack"}'
it ll print name=JACK (6 Replies)
Discussion started by: imipsita.rath
6 Replies
7. Shell Programming and Scripting
Hi..
I have two files. contents of the files are as below.
header1.dat
-------------
This is a header record.
header2.dat
-------------
This is a header record.
Date:2011-01-05
I am executing the below scripts.
HEADER1=`cat header1.dat`
HEADER2=`cat header2.dat`
awk 'BEGIN... (2 Replies)
Discussion started by: 46019
2 Replies
8. Shell Programming and Scripting
awk '{print "awk '{sub(/pdb_00/,"pdb_"$0"_00"); print}' pdb_"$0"_00.namd > tempo"; print "mv tempo pdb_"$0"_00.namd"}' datA2.dat > copy_script2.bash
This works when trying to print 'sed etc. etc' but if I switch to using AWK to print a set of AWK commands it doesn't work...
e.g. this... (3 Replies)
Discussion started by: chrisjorg
3 Replies
9. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
10. Shell Programming and Scripting
Hi,
I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1).
Input:
919143110065
919143110065
919143110052
918648846132
919143110012
918648873782
919143110152
919143110152
919143110152... (2 Replies)
Discussion started by: siramitsharma
2 Replies
lprm(1B) lprm(1B)
NAME
lprm - remove print requests from the print queue
SYNOPSIS
/usr/ucb/lprm [-P destination] [-] [ request-ID...] [user...]
The lprm utility removes print requests (request-ID) from the print queue.
Without arguments, lprm deletes the current print request. lprm reports the name of the file associated with print requests that it
removes. lprm is silent if there are no applicable print requests to remove.
Users can only remove print requests associated with their user name. See . If a superuser executes lprm and specifies the user operand,
lprm removes all print requests belonging to the specified user.
The print client commands locate destination information using the "printers" database in the name service switch. See nsswitch.conf(4),
printers(4), and printers.conf(4) for details.
The following options are supported:
-P destination The name of the printer or class of printers (see lpadmin(1M)) from which to remove print requests. Specify destination
using atomic or POSIX-style (server:destination) names. See printers.conf(4) for information regarding the naming conven-
tions for atomic names and standards(5) for information regarding POSIX.
- If a user specifies this option, removes all print requests owned by that user. If a superuser specifies this option,
removes all requests in the print queue. Job ownership is determined by the user's login name and host name on the machine
from which lpr was executed. See .
The following operands are supported.
user Removes print requests associated with a specific user. Specify user as a valid user name. This option can only be used by
a superuser.
request-ID Removes a specific print request. Specify request-ID as the job number (Job) associated with a print request and reported
by lpq. See lpq(1B).
Example 1: Removing a print request
The following example removes request-ID 385 from destination killtree:
example% lprm -P killtree 385
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
/var/spool/print/[cd]f* Spooling directories and files.
/var/spool/lp/* LP print queue
$HOME/.printers User-configurable printer database
/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
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscplp |
+-----------------------------+-----------------------------+
lp(1), lpc(1B), lpq(1B), lpr(1B), lpstat(1), lpadmin(1M), nsswitch.conf(4), printers(4), printers.conf(4), attributes(5), standards(5)
Users can only remove print requests associated with their user name. By default, users can only remove print requests on the host from
which the print request was submitted. If a superuser has set user-equivalence=true in /etc/printers.conf on the print server, users can
remove print requests associated with their user name on any host. Superusers can remove print requests on the host from which the print
request was submitted. Superusers can also remove print requests from the print server.
Some print servers send cancelation notification to job owners when their print jobs have been cancelled. This notification usually comes
in the form of an email message. Cancelation notices cannot be disabled on a Solaris server.
23 Feb 2005 lprm(1B)