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

sed, solved

Thread Tools Search this Thread Display Modes
Old Unix and Linux 01-07-2017   -   Original Discussion by cmccabe
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Join Date: May 2012
Last Activity: 21 January 2018, 9:24 PM EST
Location: Simplicity
Posts: 3,947
Thanks: 335
Thanked 1,322 Times in 1,192 Posts
For plain string matches consider the index function

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

Sponsored Links

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 01:57 AM.