Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to ignore mutiple strings when using shell script? Post 303043786 by sravani25 on Thursday 6th of February 2020 06:20:26 PM
Old 02-06-2020
How to ignore mutiple strings when using shell script?

Hi All,

I am trying to use below syntax to find ignore multiple locations while searching for a file.

Code:
find / -name "$serviceitem" ! -size 0  2>&1 |egrep -v "tmp|docker|WinSxS|Permission|HISTORY|alternatives|bearer11ssl|manifest"

I tried to assign all the ignore strings to one variable like below

Code:
ignore_list=`tmp|docker|WinSxS|Permission|HISTORY|alternatives|bearer11ssl|manifest`
find / -name "$serviceitem" ! 2>&1 |egrep -v "$ignore_list"

But it's throwing error.

Can someone please let me know how to use the above syntax.
Moderator's Comments:
Mod Comment Please use CODE TAGS for your samples as per forum rules. Also please do not use colours to your posts.

Last edited by RavinderSingh13; 02-06-2020 at 09:46 PM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

Script to assign mutiple IP's to 1 nic

I need a script to assign multiple IP addresses to a single nic. The machine is running CentOS. Any help would be appreciated. (2 Replies)
Discussion started by: ron310
2 Replies

2. Homework & Coursework Questions

strings in shell script!

hi ppl, I have a basic doubt as to how shell treats strings. e.g:given a line of data like this "5","6","45","77","89" extracting the value from each field to a variable will conatin a string("5") or just the number? If it conatins "5", how do we perform mathematical operations with that... (3 Replies)
Discussion started by: beetel
3 Replies

3. Shell Programming and Scripting

Shell script to replace strings to and from a file

Hello All, I have 2 files 1 ) source file eg asasa 1.2.3.4 adfhsdfsdfasdf zxzxzx 2.3.4.56 dsadasdasdsadasd kjjkjkjk 30.3.4.5 asdsadsadsadsadsad vxcvxcvx 1.2.3.4 qwewqewqeqweqwe 2) patern file 1.2.3.4 A 2.3.4.56 B 30.3.4.5 C I need the source to be changed to asasa A... (2 Replies)
Discussion started by: nitinkgoud
2 Replies

4. Shell Programming and Scripting

Find associated strings in a bash shell script

Hi together, unfortunately I am not a shell script guru - the following might touch the depths of awk, substr, split, regexps, where I am still fighting with - but as always the boss needs a fast solution :-( So: I have the following USER/PASSWORD-installation-config-file, from where I want to... (10 Replies)
Discussion started by: Sofie
10 Replies

5. Shell Programming and Scripting

Shell Script to ignore # and take corresponding user and group

Hi, I have a following file: role.IMPACT_USER.user=admin role.IMPACT_USER.user=dd12345 role.IMPACT_USER.user=ss76767 #role.IMPACT_USER.user=root #role.IMPACT_USER.group=System role.IMPACT_USER.group=ImpactUser #Description: Allow users to login in to Impact, start and stop service... (5 Replies)
Discussion started by: dbashyam
5 Replies

6. Shell Programming and Scripting

Ignore lines in Shell Script

Hi, I have a shell script, which reads a *.txt file - line by line. In this text file, I have some lines beginning with "#" that I want to ignore : MY_FILE #blah blah blah 1 blah blah blah 2 blah blah blah 3 #blah blah blah 4 I want my script to read only the following lines... (3 Replies)
Discussion started by: ad23
3 Replies

7. Shell Programming and Scripting

awk based script to ignore all columns from a file which contains character strings

Hello All, I have a .CSV file where I expect all numeric data in all the columns other than column headers. But sometimes I get the files (result of statistics computation by other persons) like below( sample data) SNO,Data1,Data2,Data3 1,2,3,4 2,3,4,SOME STRING 3,4,Inf,5 4,5,4,4 I... (9 Replies)
Discussion started by: ks_reddy
9 Replies

8. Shell Programming and Scripting

Shell script with mutiple steps/commands, on UNIX servers

Hi, I wrote a simple script, which will call other scripts or run commands on a UNIX server. my script has multiple steps/commands with some delay in between. I usually get some email notifications after the successful execution of each step. **My intention is to get email alerts when it is... (5 Replies)
Discussion started by: System Admin 77
5 Replies

9. Shell Programming and Scripting

Ignore Folder in Shell Script ?

Hi, I currently use a script to extract *.deb files located in a Directory called "/var/mobile/Media/Downloads" The Problem is howver I want the script to ignore the folder: "/var/mobile/Media/Downloads/New Debs and Files" (it shall NOT decompile any of the files in that folder. Here is... (2 Replies)
Discussion started by: pasc
2 Replies

10. Shell Programming and Scripting

Merge strings with ignore case

I have a bi-lingual database of a large number of dictionaries. It so happens that in some a given string is in upper case and in others it is in lower case. An example will illustrate the issue. toll Tax=पथ-कर Toll tax=राहदारी कर toll tax=टोल I want to treat all three instances of toll tax... (3 Replies)
Discussion started by: gimley
3 Replies
MONGOEXCEPTION(3)							 1							 MONGOEXCEPTION(3)

The MongoException class

INTRODUCTION
Default Mongo exception. This covers a bunch of different error conditions that may eventually be moved to more specific exceptions, but will always extend Mon- goException. o The MongoSomething object has not been correctly initialized by its constructor Code: 0 Probably your Mongo object is not con- nected to a database server. o zero-length keys are not allowed, did you use $ with double quotes? Code: 1 You tried to save "" as a key. You generally should not do this. "" can mess up subobject access and is used by MongoDB internally. However, if you really want, you can set mongo.allow_empty_keys to true in your php.ini file to override this sanity check. If you override this, it is highly recommended that you set error checking to strict to avoid string interpolation errors. o '.' not allowed in key: <key> Code: 2 You attempted to write a key with '.' in it, which is prohibited. o insert too large: <size>, max: <max> Code: 3 You're attempting to send too much data to the database at once: the database will only accept inserts up to a certain size (currently 16 MB). o no elements in doc Code: 4 You're attempting to save a document with no fields. o size of BSON doc is <size> bytes, max <max>MB Code: 5 You're attempting to save a document that is larger than MongoDB can save. o no documents given Code: 6 You're attempting to batch insert an empty array of documents. o MongoCollection::group takes an array, object, or MongoCode key Code: 7 Wrong type parameter send to MongoCollection.group(3). o field names must be strings Code: 8 You should format field selectors as array("field1" => 1, "field2" => 1, ..., "fieldN" => 1). o invalid regex Code: 9 The regex passed to MongoRegex is not of the correct form. o MongoDBRef::get: $ref field must be a string Code: 10 o MongoDBRef::get: $db field must be a string Code: 11 o non-utf8 string: <str> Code: 12 This error occurs if you attempt to send a non-utf8 string to the database. All strings going into the database should be UTF8. See php.ini options for the transition option of quieting this exception. o mutex error: <err> Code: 13 The driver uses mutexes for synchronizing requests and responses in multithreaded environments. This is a fairly serious error and may not have a stack trace. It's unusual and should be reported to maintainers with any system information and steps to reproduce that you can provide. o index name too long: <len>, max <max> characters Code: 14 Indexes with names longer than 128 characters cannot be created. If you get this error, you should use MongoCollection.ensureIndex(3)'s "name" option to create a shorter name for your index. CLASS SYNOPSIS
MongoException MongoExceptionextends Exception PHP Documentation Group MONGOEXCEPTION(3)
All times are GMT -4. The time now is 07:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy