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

Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 01-07-2017   -   Original Discussion by cmccabe
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 19 November 2017, 3:04 AM EST
Location: Simplicity
Posts: 3,823
Thanks: 318
Thanked 1,281 Times in 1,159 Posts
For plain string matches consider the index function

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

Sponsored Links
Closed

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 02: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 05:04 PM
How to print Specific keyword, by using awk? ooilinlove Shell Programming and Scripting 4 03-09-2012 01:11 PM
compare two files and search keyword and print output cdfd123 Shell Programming and Scripting 5 12-03-2010 08:45 AM
how to search a keyword within a file using a for loop lucho_1 Shell Programming and Scripting 6 03-10-2008 03:57 PM



All times are GMT -4. The time now is 06:40 AM.