Sponsored Content
Full Discussion: pattern searching
Top Forums Shell Programming and Scripting pattern searching Post 302703013 by danish0909 on Wednesday 19th of September 2012 08:58:39 AM
Old 09-19-2012
Code:
ls -1 *.jar|awk -F "_live" '{print $1"_live"}'

gives me output as ericsson_msc_live

and the below gives me the date (or only numbers in the string)

Code:
ls -1 *.jar|awk -F "_live" '{print $2}'|sed "s/[^0-9]//g"|awk '{print substr($0,1,8)}'

but the problem is, the above command gives me this too 12012072, which is not the date because the string contains 'western1_20120809.jar' also

hope that helps
 

10 More Discussions You Might Find Interesting

1. Programming

pattern searching using C

i think grep can only find char in files matching a pattern without any wildcards like ? correct? It works with * but not ?. how can i write a small c program to find words in a file, like a list, that matches a pattern like ma?y, b??con, etc if grep doesn't understand ? in a pattern search. if... (1 Reply)
Discussion started by: giannicello
1 Replies

2. Filesystems, Disks and Memory

Searching for a pattern in a Directory

How to search a given pattern in the files which are present in my current working directory and its subdirectories recursively (1 Reply)
Discussion started by: gandhevinod
1 Replies

3. Shell Programming and Scripting

Regarding Searching Pattern

Hi Guys, Can you help with the shell script: I would like to search a fixed width pattern from a file say for each line from a fixed position and lenght it has to return all rows from the file. Example: To search the third column for "def" it has to return 1 and 4th rows only ... (2 Replies)
Discussion started by: sbasetty
2 Replies

4. Shell Programming and Scripting

Pattern searching pattern in c files

I have a problem in searching a specific pattern in c files. My requirement: I have to find all the division operator in all cfiles. The problem is, the multi line comments and single line comments will also have forward slash in it. Even after avoiding these comments also, if both... (6 Replies)
Discussion started by: murthybptl
6 Replies

5. Shell Programming and Scripting

searching for a pattern

can anybode tell me ? I want to search for a pattern present in a whole directory and subdirectories's files containg " crat" I tried grep -r "crat" */* ; is it right ? (3 Replies)
Discussion started by: pranabrana
3 Replies

6. Shell Programming and Scripting

Searching a pattern in file and deleting th ewhole line containing the pattern

Hi All, Please can someone assist in the script I have made that searches a pattern in a file and delete the whole line containing the pattern. #!bin/sh # The pattern that user want to add to the files echo "Enter the pattern of the redirect" read value # check if the user has... (1 Reply)
Discussion started by: Shazin
1 Replies

7. Shell Programming and Scripting

Searching for a pattern

How do I search for a pattern - N/A in a particular column using awk? (11 Replies)
Discussion started by: rabiu
11 Replies

8. UNIX for Dummies Questions & Answers

Pattern searching

Hi, I need small help from you people. In a directory there are around 150 odd files and few them contain the word "TRACK" and few are not. How can I find out the the list of those files which doesn't contain the word "TRACK"? Thanks, Siba (4 Replies)
Discussion started by: siba.s.nayak
4 Replies

9. UNIX for Dummies Questions & Answers

searching pattern in VI

in my file i have somthing likre kpk_12 kpk_1 kpk_1.tcl kpk_3.tcl kpk kpk kpk i want search only kpk i am using this cmd /kpk ...results it is showing all . any cmd is ther other then this to search exactword in this example kpk it shoulsnot show kpk_* etc Thanks in Advance ... (2 Replies)
Discussion started by: prakumar
2 Replies

10. Shell Programming and Scripting

Searching for a pattern and extracting records related to that pattern

Hi there, Looking forward to your advice for the below: I have a file which contains 2 paragraphs related to a particular pattern. I have to search for those paragraphs from a log file and then print a particular line from those paragraphs. Sample: I have one file with the fixed... (3 Replies)
Discussion started by: danish0909
3 Replies
BND(1)							     BND for Debian GNU/Linux							    BND(1)

NAME
bnd - Create and diagnose OSGi R4 bundles. SYNOPSIS
bnd [general-options] [cmd] [cmd-options] bnd [general-options] <file>.jar bnd [general-options] <file>.bnd DESCRIPTION
The bnd tool helps you create and diagnose OSGi R4 bundles. The key functions are: * Show the manifest and JAR contents of a bundle * Wrap a JAR so that it becomes a bundle * Create a Bundle from a specification and a class path * Verify the validity of the manifest entries GENERAL OPTIONS
-failok Same as the property -failok. The current run will create a JAR file even if there were errors. -exceptions Will print the exception when the software has ran into a bad exception and bails out. Normally only a message is printed. For debugging or diagnostic reasons, the exception stack trace can be very helpful. COMMANDS
print ( -verify | -manifest | -list | - all ) * <file>.jar + The print function will take a list of JAR file and print one or more aspect of the JAF riles. The following aspects can be added. * -verify - Verify the JAR for consistency with the specification The print will exit with an error if the verify fails. * -manifest - Show the manifest * -list - List the entries in the JAR file * -all - Do all (this is the default. "bnd print -verify *.jar" buildx ( -classpath LIST | -eclipse <lt>file> | -noeclipse | -output <file> ) * <file>.bnd + The build function will assemble a bundle from the bnd specification. The default name of the output bundle is the name of the bnd file with a .jar extension. * -classpath - A list of JAR files and/or directories that should be placed on the class path before the calculation starts. * -eclipse - Parse the file as an Eclipse .classpath file, use the information to create an Eclipse's project class path. If this option is used, the default .classpath file is not read * -noeclipse - Do not parse the .classpath file of an Eclipse project. * -output - Override the default output name of the bundle or the directory. If the output is a directory, the name will be derived from the bnd file name. "bnd build -classpath bin -noeclipse -output test.jar xyz.bnd" wrap ( -classpath (<lt>file>(','<lt>file>)*)-output <lt>fileE|dir<gt> | -properties <lt>file> ) * -ignoremanifest? <lt>file>.jar * The wrap command takes an existing JAR file and guesses the manifest headers that will make this JAR useful for an OSGi Service Platform. If the output file is not overridden, the name of the input file is used with a .bar extension. The default bnd file for the header calculation is: Export-Package: * Import-Package: <packages inside the target jar> If the target bundle has a manifest, the headers are merged with the properties. The defaults can be overridden with a specific properties file. * -output - Set the output file or directory * -classpath - Sets the classpath as a comma separated list * -properties - Use a special property file for the manifest calculation. * -ignoremanifest - Do not include the manifest headers from the target bundle "bnd wrap -classpath osgi.jar *.jar" SEE ALSO
<http://www.aqute.biz/Code/Bnd> AUTHOR
Ludovic Claude <ludovic.claude@laposte.net> Damien Raude-Morvan <drazzib@debian.org> bnd-1.50.0 2011-10-25 BND(1)
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy