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
TM::Axes(3pm)						User Contributed Perl Documentation					     TM::Axes(3pm)

NAME
TM::Axes - Topic Maps, Axes for TM::match* DESCRIPTION
The TM module offers the method "match" (and friends) to query assertions in a TM data structure. While there is a generic search specification, it will be too slow. Instead some axes have been implemented specifically. These are listed below. SEARCH SPECIFICATIONS
Automatically generated from TM (1.54) Code:<empty> returns all assertions Code:anyid return all assertions where a given toplet appears somehow 'anyid' => 'the toplet' Code:aplayer.arole.bplayer.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role with another given toplet as player 'bplayer' => 'the player for the brole', 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:aplayer.arole.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:char.irole deprecated: return all assertions which are characteristics for a given toplet 'irole' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic return all assertions which are characteristics for a given toplet 'topic' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic.type return all assertions which are a characteristic of a given type for a given topic 'topic' => 'the toplet for which these characteristics are sought', 'char' => '1', 'type' => 'type of characteristic' Code:char.type return all assertions which are characteristics for some given type 'char' => '1', 'type' => 'the characteristic type' Code:char.type.value return all assertions which are characteristics for some topic of a given value for some given type 'value' => 'the value for which all characteristics are sought', 'char' => '1', 'type' => 'the characteristic type' Code:char.value return all assertions which are characteristics for some topic of a given value 'value' => 'the value for which all characteristics are sought', 'char' => '1' Code:class.type returns all assertions where there are instances of a given toplet 'class' => 'which toplet should be the class', 'type' => 'isa' Code:instance.type returns all assertions where there are classes of a given toplet 'type' => 'isa', 'instance' => 'which toplet should be the instance' Code:iplayer return all assertions where a given toplet is a player 'iplayer' => 'the player toplet' Code:iplayer.irole return all assertions where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)' Code:iplayer.irole.type return all assertions of a given type where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:iplayer.type return all assertions of a given type where a given toplet is a player 'iplayer' => 'the player toplet', 'type' => 'the type of the assertion' Code:irole return all assertions where there is a given role 'irole' => 'the role toplet (incl subclasses)' Code:irole.type return all assertions of a given type where there is a given role 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:lid return one particular assertions with a given ID 'lid' => 'the ID of the assertion' Code:nochar returns all associations (so no names or occurrences) 'nochar' => '1' Code:subclass.type returns all assertions where there are subclasses of a given toplet 'subclass' => 'which toplet should be the superclass', 'type' => 'is-subclass-of' Code:superclass.type returns all assertions where there are superclasses of a given toplet 'superclass' => 'which toplet should be the subclass', 'type' => 'is-subclass-of' Code:type return all assertions with a given type 'type' => 'the type of the assertion' SEE ALSO
TM COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-06-20 TM::Axes(3pm)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy