bash many patterns


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash many patterns
# 1  
Old 06-09-2012
bash many patterns

hi guys

in my bash script I call wget to check for valid links like this:

Code:
wget -q "$1" -O- | grep -ow "href=\"http://[^\"]*\"" | sed -e 's/href=//g' -e 's/"//g'

but this only finds the urls starting with http.What if I also want to find the urls starting with Https and https?
# 2  
Old 06-09-2012
add the -i option for case insensitive. or change the pattern [Hh].
This User Gave Thanks to frank_rizzo For This Post:
# 3  
Old 06-10-2012
Ok for the case snsitive but also I have http and I want https ..
any ideas for that?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash - Find files excluding file patterns and subfolder patterns

Hello. For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Discussion started by: jcdole
2 Replies

2. Shell Programming and Scripting

Bash shell script not working-picking segment patterns from a file

Hi All, I have to pick particular segments from a file and I have prepared below shell script.But its not working and I am not able to find out whats the issue.could you guys pls help? Sample file: TS3*1451575*12*20151231*4*482.44 NM1*QC*1*CUTLER*BETTY DTM*472*20150808... (4 Replies)
Discussion started by: Venkata Prasad
4 Replies

3. Shell Programming and Scripting

Regex patterns

can someone please confirm for me if i'm right: the pattern: ORA-0*(600?|7445|4) can someone give me an idea of all the entries the pattern above will grab from a database log file? is it looking for the following strings?: ORA-0600 ORA-7445 4) (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Find matched patterns and print them with other patterns not the whole line

Hi, I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Discussion started by: redse171
3 Replies

5. Shell Programming and Scripting

MultiLine Patterns

Experts, I am novice unix user. At my work, most of our DBA's work on creating DDL's to create new tables in production. At every week we need to validate the scripts (do peer review) and it takes a while and also it is not effective when we have like 150 tables created in the scripts. I am... (3 Replies)
Discussion started by: ysvsr1
3 Replies

6. Shell Programming and Scripting

printing patterns

I have the following file : 1 2 3 4 5 6 7 8 9 0 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 Write scripts to get the following outputs : A) 1 7 7 1 4 (11 Replies)
Discussion started by: pssooraj72
11 Replies

7. Shell Programming and Scripting

Searching patterns in 1 file and deleting all lines with those patterns in 2nd file

Hi Gurus, I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies

8. Shell Programming and Scripting

How to get value between patterns

Gurus, If is my file <PRODUCT_TYPE>DN</PRODUCT_TYPE><SERVER_NAME>testserver1</SERVER_NAME><FLAVOR>Windows</FLAVOR><OS>Windows NT</OS><CPU>4</CPU> <PRODUCT_TYPE>PN</PRODUCT_TYPE><SERVER_NAME>testserver2</SERVER_NAME><FLAVOR>Windows</FLAVOR><OS>Windows NT</OS><CPU>3</CPU> ... (6 Replies)
Discussion started by: sirababu
6 Replies

9. Shell Programming and Scripting

How to get lines in between Patterns?

Hi, I need to create a script that does the following: 1. Read the file for the occurrences of "EXECUTE" and "END" strings. There will be several occurrences of EXECUTE and END strings on the file. 2. The resulting lines in #1, needs to be searched for the word... (11 Replies)
Discussion started by: racbern
11 Replies

10. Shell Programming and Scripting

get the value between 2 patterns

hello experts, I want to get the value between 2 patterns. ex. get hello in <line>hello</line> Any suggestions? any sed, grek, awk commands? (11 Replies)
Discussion started by: minifish
11 Replies
Login or Register to Ask a Question