Sponsored Content
Top Forums Shell Programming and Scripting Single grep to multiple strings with separate output per string Post 303003480 by nms on Thursday 14th of September 2017 09:07:13 AM
Old 09-14-2017
Hi RavinderSingh13,

Yes that works.
The output is
CRITICAL 919.

However I would like to know if it's possible to include multiple strings.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep Multiple Strings

Hi, Can any one pelase tell me how to grep multiple strings from multiple files in a singel folder? grep -E "string1|string2|string3|string4|string..." its taking lots of time.. can any please tell me fast grep??? URGENT (10 Replies)
Discussion started by: durgaprasad
10 Replies

2. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

3. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

4. UNIX for Dummies Questions & Answers

awk to match multiple regex and create separate output files

Howdy Folks, I have a list that looks like this: (file2.txt) AAA BBB CCC DDD and there are 24 of these short words. I am matching these patterns to another file with 755795 lines (file1.txt). I have this code for matching: awk -v f2=file2.txt ' BEGIN { while(... (2 Replies)
Discussion started by: heecha
2 Replies

5. Shell Programming and Scripting

Grep multiple strings in multiple files

Hi, every one! I have a file with multiple strings. file1 ATQRGNE ASQGVKFTE ASSQYRDRGGLET SPEQGARSDE ASSRDFTDT ASSYSGGYE ASSYTRLWNTGE ASQGHNTD PSLGGGNQPQH SLDRDSYNEQF I want to grep each string in hundreds of files in the same directory, further, I want to find out the string... (7 Replies)
Discussion started by: xshang
7 Replies

6. Shell Programming and Scripting

Can't grep multiple strings

I have a script that periodically checks the Apache error_log to search for a specific error that causes it to hand and, if found, it restarts the service. I recently found another error that forces it to hand and won't serve pages until it is reset. What I'm trying to do is to get the script to... (3 Replies)
Discussion started by: cfjohnsn
3 Replies

7. Shell Programming and Scripting

Multiple search strings replaced with single string

Hi, I need someone's help in writing correct perl code. I implemented following code for "multiple search strings replaced with single string". ========================================================= #!/usr/bin/perl my $searchStr = 'register_inst\.write_t\(' |... (2 Replies)
Discussion started by: chettyravi
2 Replies

8. Shell Programming and Scripting

Find multiple strings and replace single string

Hi, following Perl code i used for finding multiple strings and replace with single string. code: #!/usr/bin/perl my @files = <*.txt>; foreach $fileName (@files) { print "$fileName\n"; my $searchStr = ',rdata\)' | ',,rdata\)' | ', ,rdata\)'; my $replaceStr =... (2 Replies)
Discussion started by: chettyravi
2 Replies

9. Shell Programming and Scripting

Grep strings on multiple files and output to multiple files

Hi All, I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results. #!/bin/ksh ( a="/path/file1" b="path/file2" for file in... (4 Replies)
Discussion started by: am24
4 Replies

10. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
LUCKYBACKUP(8)						      System Manager's Manual						    LUCKYBACKUP(8)

NAME
luckybackup - a powerful, fast and reliable backup & sync tool SYNOPSIS
luckybackup [OPTIONS]... [FILE]... DESCRIPTION
luckybackup is an application that backs-up and/or synchronizes any directories with the power of rsync OPTIONS
--help displays this help message --version displays the current version of the application --skip-critical does not execute tasks that appear with a 'CRITICAL' warning message --dry-run executes luckybackup in dry-run (simulation) mode --silent executes luckybackup in silent mode (just tray notification icon shown) -c console mode. Use this, if there is no graphical envrironment available --no-questions skips confirmation questions asked to user. Implies -c (console mode) [FILE] is the filename of the already created profile that is going to be executed examples 1. Execute luckybackup gui : $ luckybackup 2. Execute luckybackup in silent mode for profile '~/.luckyBackup/profiles/BackupHome.profile' : $ luckybackup --silent ~/.luckyBackup/profiles/BackupHome.profile 3. Execute luckybackup in console mode for profile '~/.luckyBackup/profiles/BackupHome.profile' : $ luckybackup -c BackupHome.profile 4. Execute luckybackup in console mode for profile '~/.luckyBackup/profiles/BackupHome.profile' Do not ask any questions and skip all operations that appear CRITICAL after the checks : $ luckybackup --skip-critical --no-questions ~/.luckyBackup/profiles/BackupHome.profile SEE ALSO
For a complete documentation, please have a look at the application manual via the gui main window help menu. AUTHOR
luckybackup was written by <Loukas Avgeriou>. This manual page was written by luckyb <luckyb69@sourceforge.net>, for the Debian project (but may be used by others). 2011-01-12 LUCKYBACKUP(8)
All times are GMT -4. The time now is 09:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy