Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Bash to print if keyword not in file

Shell Programming and Scripting


Tags
sed, solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 01-07-2017
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 23 April 2017, 2:13 PM EDT
Location: Simplicity
Posts: 3,498
Thanks: 273
Thanked 1,160 Times in 1,053 Posts
For plain string matches consider the index function

Code:
if (index($0,i) || ! index($0,"Medexome.tar.bz2")) p=0

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Print all lines between two keyword if a specific pattern exist Amit Joshi Shell Programming and Scripting 8 08-14-2015 01:35 PM
Search for a Keyword in file and replace another keyword or add at the end of line dashing201 Shell Programming and Scripting 7 05-05-2014 04:04 PM
How to print Specific keyword, by using awk? ooilinlove Shell Programming and Scripting 4 03-09-2012 12:11 PM
compare two files and search keyword and print output cdfd123 Shell Programming and Scripting 5 12-03-2010 07:45 AM
how to search a keyword within a file using a for loop lucho_1 Shell Programming and Scripting 6 03-10-2008 02:57 PM



All times are GMT -4. The time now is 09:38 PM.