Sponsored Content
Top Forums Shell Programming and Scripting egrep -i "(from|to)=<$1>" mail.log ? Post 302635007 by Scrutinizer on Friday 4th of May 2012 05:45:34 AM
Old 05-04-2012
What does not work? What is your OS and version?
Code:
$ echo "$1"
double-bounce@prx1.example.com
$ echo 'May  3 00:00:29 prx1-mgmt postfix/qmgr[3781]: 88BFC2FB802: from=<double-bounce@prx1.example.com>, size=288, nrcpt=1 (queue active)' |
> grep -Ei "(from|to)=<$1>"
May  3 00:00:29 prx1-mgmt postfix/qmgr[3781]: 88BFC2FB802: from=<double-bounce@prx1.example.com>, size=288, nrcpt=1 (queue active)
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

2. UNIX for Dummies Questions & Answers

How to use the "grep/egrep" command to search files.

Hi Team, I am new to this forum and also trying to learn Unix. I will highly appriciate your help if you can help me to get the right command . {{{ I use the command " today | egrep '(10:| 11: )' | grep ERROR " to grep all the files that has been error betweeen 10 to 11... (6 Replies)
Discussion started by: rkhanal
6 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. AIX

echo $varibla | mail -s "subject" "xxx@xxx.com" not ruuning as expected

Hi Folks, As per the subject, the following command is not working as expected. echo $variable | mail -s "subject" "xxx@xxx.com" Could anyone figure it out whats wrong with this. I am using AIX box. Regards, (2 Replies)
Discussion started by: gjarms
2 Replies

5. Shell Programming and Scripting

Escaping backslash and asterisk in egrep to match "\*"

So far what i've got is egrep '^(\\)\*$'No luck. I've searched the web and not much luck. I know about the escape character \ but its confusing to figure out how to use it to match a backslash and use it to escape the asterisk also. Any ides? Thanks! (8 Replies)
Discussion started by: matthewfs
8 Replies

6. UNIX for Dummies Questions & Answers

Egrep confusion with "I" and "-I" pattern

I am executing following command egrep -w I filename.txt the filename.txt has following data .... -I 07-18 08:31:19.924 9880 6 SessionManager ConnectConfig: ConfigurationWebService LoginResults=SuccessfulLogin I am so hungry that I need to eat I expect egrep to print only the second... (1 Reply)
Discussion started by: VBG
1 Replies

7. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
qmgr(1B)								PBS								  qmgr(1B)

NAME
qmgr - pbs batch system manager SYNOPSIS
qmgr [-a] [-c command] [-e] [-n] [-z] [server...] DESCRIPTION
The qmgr command provides an administrator interface to the batch system. The command reads directives from standard input. The syntax of each directive is checked and the appropriate request is sent to the batch server or servers. The list or print subcommands of qmgr can be executed by general users. Creating or deleting a queue requries PBS Manager privilege. Set- ting or unsetting server or queue attributes requires PBS Operator or Manager privilege. OPTIONS
-a Abort qmgr on any syntax errors or any requests rejected by a server. -c command Execute a single command and exit qmgr . -e Echo all commands to standard output. -n No commands are executed, syntax checking only is performed. -z No errors are written to standard error. OPERANDS
The server operands identify the name of the batch server to which the administrator requests are sent. Each server conforms to the fol- lowing syntax: host_name[:port] where host_name is the network name of the host on which the server is running and port is the port number to which to connect. If port is not specified, the default port number is used. If server is not specified, the administrator requests are sent to the local server. STANDARD INPUT
The qmgr command reads standard input for directives until end of file is reached, or the exit or quit directive is read. STANDARD OUTPUT
If Standard Output is connected to a terminal, a command prompt will be written to standard output when qmgr is ready to read a directive. If the -e option is specified, qmgr will echo the directives read from standard input to standard output. STANDARD ERROR
If the -z option is not specified, the qmgr command will write a diagnostic message to standard error for each error occurrence. EXTENDED DESCRIPTION
If qmgr is invoked without the -c option and standard output is connected to a terminal, qmgr will write a prompt to standard output and read a directive from standard input. Commands can be abbreviated to their minimum unambiguous form. A command is terminated by a new line character or a semicolon, ";", char- acter. Multiple commands may be entered on a single line. A command may extend across lines by escaping the new line character with a back-slash "". Comments begin with the # character and continue to end of the line. Comments and blank lines are ignored by qmgr. DIRECTIVE SYNTAX
A qmgr directive is one of the following forms: command server [names] [attr OP value[,attr OP value,...]] command queue [names] [attr OP value[,attr OP value,...]] command node [names] [attr OP value[,attr OP value,...]] Where, command is the command to perform on a object. Commands are: active sets the active objects. If the active objects are specified, and the name is not given in a qmgr cmd the active object names will be used. create is to create a new object, applies to queues and nodes. delete is to destroy an existing object, applies to queues and nodes. set is to define or alter attribute values of the object. unset is to clear the value of attributes of the object. Note, this form does not accept an OP and value, only the attribute name. list is to list the current attributes and associated values of the object. print is to print all the queue and server attributes in a format that will be usable as input to the qmgr command. names is a list of one or more names of specific objects The name list is in the form: [name][@server][,queue_name[@server]...] with no intervening white space. The name of an object is declared when the object is first created. If the name is @server, then all the objects of specified type at the server will be effected. attr specifies the name of an attribute of the object which is to be set or modified. If the attribute is one which consist of a set of resources, then the attribute is specified in the form: attribute_name.resource_name OP operation to be performed with the attribute and its value: = set the value of the attribute. If the attribute has a existing value, the current value is replaced with the new value. += increase the current value of the attribute by the amount in the new value. -= decrease the current value of the attribute by the amount in the new value. value the value to assign to an attribute. If the value includes white space, commas or other special characters, such as the # char- acter, the value string must be inclosed in quote marks ("). The following are examples of qmgr directives: create queue fast priority=10,queue_type=e,enabled = true,max_running=0 set queue fast max_running +=2 create queue little set queue little resources_max.mem=8mw,resources_max.cput=10 unset queue fast max_running set node state = down,offline active server s1,s2,s3 list queue @server1 set queue max_running = 10 - uses active queues EXIT STATUS
Upon successful processing of all the operands presented to the qmgr command, the exit status will be a value of zero. If the qmgr command fails to process any operand, the command exits with a value greater than zero. SEE ALSO
pbs_server(8B), pbs_queue_attributes(7B), pbs_server_attributes(7B), qstart(8B), qstop(8B), qenable(8B), qdisable(8), pbs_resources(7B) and the PBS External Reference Specification Local qmgr(1B)
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy