Sponsored Content
Top Forums Shell Programming and Scripting Performing fast searching operations with a bash script Post 302321578 by cjcox on Monday 1st of June 2009 01:49:47 PM
Old 06-01-2009
Concatenate all the contents of the html files into one big file. The do searches for the filenames in parallel over that file, on non-matches print the pattern (use grep -m 1 if using GNU grep to prevent searching the whole file on match). If you have the memory for the html concat (to be cached), should be pretty fast.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

fast searching algorithm

hello, i need a searching algorithm in unix. since my input file is very bulky, so need a real fast searching algorithm, to match words. i am already using grep. (3 Replies)
Discussion started by: rochitsharma
3 Replies

2. UNIX for Advanced & Expert Users

Performing Script on Multiple Files

Dear All I have group of files named : CDR.1,CDR.2.,CDR.3,CDR.4,CDR.5,CDR.6,etc....... I am performing an awk command look like this : nawk -f script CDR.* What i want is that i want to perform this command on range of files not all of them. Instead of writing CDR.* i want to write... (3 Replies)
Discussion started by: zanetti321
3 Replies

3. Shell Programming and Scripting

Bash script for searching a string

Hi, I have a file that contains thousands of records. Each record starts with "New Record". I need to search this file based on a given value of "timestamp" and write all the records that match this timestamp into a new file. I was able to locate the existence of a given value of timestamp using... (10 Replies)
Discussion started by: shoponek
10 Replies

4. Shell Programming and Scripting

Need help is manipulating a file with some arithmetic operations using bash script

Friends, I have a file with contents like: interface Serial0/4/0/0/1/1/1/1:0 encapsulation mfr multilink group 101 Now I need to manipulate the file in such a way that to all the numbers less than 163, 63 gets added and to all numbers greater than 163, 63 gets deducted.(The numbers... (2 Replies)
Discussion started by: shrijith1
2 Replies

5. Shell Programming and Scripting

Performing remote operations in a script

I have a scropt that looks something like this: #!/bin/bash ssh user@domain1.com sleep 10 some_command exit ssh different_user@domain2.com sleep 10 some_command exit However, the script is not logging into those accounts and doing the actions. The accounts are configured in my... (3 Replies)
Discussion started by: dotancohen
3 Replies

6. Shell Programming and Scripting

Arithmetic operations in bash,ksh,sh

Guys, The below expression is valid in which shells (sh,ksh,bash,csh)? VAR1=2 VAR2=$(($VAR1 -2)) Thanks (1 Reply)
Discussion started by: rprajendran
1 Replies

7. Shell Programming and Scripting

Can BASH handle mathematical operations and do a Search & Replace?

Hello, I have a bunch of xml file that needs to have edits made and I was wondering if a BASH script could handle it. I would like the script to look within my xml files and replace all integers greater than 5px with a value that is 25% smaller. For example, 100px = 75px. Since the integers... (12 Replies)
Discussion started by: jl487
12 Replies

8. Shell Programming and Scripting

Reading the data from CSV and performing search through shell script

Hello, I am working on building a script that does the below actions together in my Linux server. 1) First, have to read the list of strings mentioned in CSV and store it in the shell script 2) Second, pick one by one from the string list, and search a particular folder for files that... (2 Replies)
Discussion started by: vikrams
2 Replies

9. Shell Programming and Scripting

Performing arithmetic operations on output of `wc -l`

Hi I want to perform arithmetic operations on output of `wc -l`. for example user046@sshell ~ $ ls -l total 0 where "total 0" will increase one line in wc -l filecount=`ls -l | wc -l` here $filecount will be 1 but is should be 0 how to get rid of it ? (1 Reply)
Discussion started by: anandgodse
1 Replies

10. Shell Programming and Scripting

Where to place operations bash scripts?

As I have sometimes problems with passenger module loading correctly after restart of apache2 we wrote a short bash-script to check correct loading of application (redmine) and - if not- restarting apache2 until application is loaded by passenger. Script is invoked using cron. To do everything... (2 Replies)
Discussion started by: awilhelmy
2 Replies
BZGREP(1)						      General Commands Manual							 BZGREP(1)

NAME
bzgrep, bzfgrep, bzegrep - search possibly bzip2 compressed files for a regular expression SYNOPSIS
bzgrep [ grep_options ] [ -e ] pattern filename... bzegrep [ egrep_options ] [ -e ] pattern filename... bzfgrep [ fgrep_options ] [ -e ] pattern filename... DESCRIPTION
Bzgrep is used to invoke the grep on bzip2-compressed files. All options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If bzgrep is invoked as bzegrep or bzfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, bzgrep uses it as the grep program to be invoked. For example: for sh: GREP=fgrep bzgrep string files for csh: (setenv GREP fgrep; bzgrep string files) AUTHOR
Charles Levert (charles@comm.polymtl.ca). Adapted to bzip2 by Philippe Troin <phil@fifi.org> for Debian GNU/Linux. SEE ALSO
grep(1), egrep(1), fgrep(1), bzdiff(1), bzmore(1), bzless(1), bzip2(1) BZGREP(1)
All times are GMT -4. The time now is 03:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy