Sponsored Content
Top Forums Shell Programming and Scripting Combine two lists From Multiple Grep commands. Post 302504034 by penchal_boddu on Sunday 13th of March 2011 07:59:00 AM
Old 03-13-2011
Hi Pravin,

Code:
perl -nle 'printf "$1\t" if /unix="(.+?)"/>$/;print $1 if m/<body>(.*)<\/body>/;'  input.xmls

I have two queries.

1. Is there any special reason why we are going for non-greddy matching(.+?)
2. In the first if statement , the delimiters are not provided properly. I think its treating ">" as redirection operator .

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. AIX

grep using lists?

I have a file that contain a list of files. How can I use grep to search the files in the list for a specific pattern? (2 Replies)
Discussion started by: bbbngowc
2 Replies

2. UNIX for Dummies Questions & Answers

Combine commands

Hi, i tried to combine grep with find and it didnt work grep 'find dirname filename" i also would like that the file will be sorted in the way. thanks a lot. (2 Replies)
Discussion started by: Spoiler
2 Replies

3. Shell Programming and Scripting

Can I combine these two commands into one?

sed -e :a -e 's/<*>//g;/</N;//ba' a2.html -removes html tags and sed -i 's/YOURS TRULY/Joe Bob/' a2.html Replaces a string with another string can i make it into one string? (2 Replies)
Discussion started by: boyboy1212
2 Replies

4. Shell Programming and Scripting

Combine multiple awk commands

Hi Team, I am getting input like below $ ps -ef | grep pmon | grep -v asm | grep -v grep oracle 3246 1 0 00:03 ? 00:00:01 ora_pmon_racora1 oracle 4367 1 0 00:03 ? 00:00:01 ora_pmon_test1 oracle 6893 1 0 00:03 ? 00:00:01 ora_pmon_gipora1... (6 Replies)
Discussion started by: kamauv234
6 Replies

5. Shell Programming and Scripting

Turning my lists into useable copy commands

Hello everyone! I currently work in the motion picture industry and we constantly receive lists of missing media from our sound department. I use a series of commands in TextWrangler in order to remake the lists into useable copy commands to automate the whole process but if I could make this work... (9 Replies)
Discussion started by: grep_me_please
9 Replies

6. UNIX for Dummies Questions & Answers

Combine two lists of variables

Thanks in advance for any advice and help. I have two lists of variables that I want to put into nested for loops. for x in 1 2 3 do for y in a b c do The output I want is: filepath/1/ command modified by a filepath/2/ command modified by b filepath/3/ command modified by c To... (10 Replies)
Discussion started by: wheyhamp
10 Replies

7. Shell Programming and Scripting

Csh - how to combine multiple commands in one line

Hey everyone, I am working in an environment where the different users can use ksh or csh. My situation is that I need the same result with one single command line. I am searching for the real path the file is in. My ksh input and output ts2:ts2adm> cd $(dirname $(which sapcontrol)); pwd -P... (2 Replies)
Discussion started by: h1kelds
2 Replies

8. Shell Programming and Scripting

Combine multiple commands

I have the following sh-script: konsole -T todo -e vi todo.txt & konsole -T window1 -e ssh user@server & konsole -T window2 -e ssh user@server2 -e cd directory & The first two lines are working fine. The first opens a txt-file, the second opens a ssh-connection. The third line... (6 Replies)
Discussion started by: andre666
6 Replies

9. UNIX for Beginners Questions & Answers

Can I combine below mentioned grep commands using OR (when searching strings having spaces)

Command 1: $script | grep 'Write to ECC( SSID=MARGIN)' Command 2: $script | grep 'is not greater than existing logical processing' The above commands run my script and search the mentioned strings but I do not want to run my script twice. It is increasing run time. Can someone tell me... (3 Replies)
Discussion started by: Tanu
3 Replies

10. Shell Programming and Scripting

Combine 2 Commands

Hello, I have the following code. I wonder if it can be combined into 1 command. y=`ls -1| tail -n 1` m=${y%.abc} Thank you. (3 Replies)
Discussion started by: april
3 Replies
PLSDIDEV(3plplot)						    PLplot API							 PLSDIDEV(3plplot)

NAME
plsdidev - Set parameters that define current device-space window SYNOPSIS
plsdidev(mar, aspect, jx, jy) DESCRIPTION
Set relative margin width, aspect ratio, and relative justification that define current device-space window. If you want to just use the previous value for any of these, just pass in the magic value PL_NOTSET. It is unlikely that one should ever need to change the aspect ratio but it's in there for completeness. If plsdidev(3plplot) is not called the default values of mar, jx, and jy are all 0. aspect is set to a device-specific value. Redacted form: plsdidev(mar, aspect, jx, jy) This function is used in example 31. ARGUMENTS
mar (PLFLT, input) Relative margin width. aspect (PLFLT, input) Aspect ratio. jx (PLFLT, input) Relative justification in x. Value must lie in the range -0.5 to 0.5. jy (PLFLT, input) Relative justification in y. Value must lie in the range -0.5 to 0.5. AUTHORS
Geoffrey Furnish and Maurice LeBrun wrote and maintain PLplot. This man page was automatically generated from the DocBook source of the PLplot documentation, maintained by Alan W. Irwin and Rafael Laboissiere. SEE ALSO
PLplot documentation at http://plplot.sourceforge.net/resources. August, 2012 PLSDIDEV(3plplot)
All times are GMT -4. The time now is 12:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy