Regular Expressions in K Shell Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Regular Expressions in K Shell Script
# 1  
Old 07-12-2010
Regular Expressions in K Shell Script

HTML Code:
I need to write a K shell script to find full file names , line numbers and lines which have words meeting either of following 2 criterias -
1)words which are 6 to 8 character long and alphanumeric.
2)Minimum 8 characters, one upper case, one lower case letter, one of the special characters within list (~,!,$,%,^,&,-,=,.,:,;)
I need create an o/p file like
file name - <>
matching line number - <>
matching line - <>
Struggling with regular expressions, but no luck yet. Appreciate your inputs.
Note - I need to start searching from root directpry, so the files to be searched would be very huge in number as well as volume.
O.S. is  Sun 5.10
# 2  
Old 07-12-2010
What have you tried so far?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular expressions in tcsh script

Hi, I have a shell script in tcsh to which I pass an argument, the length of which can vary. The possible values of the argument are the letters -c,s,i,q,a. and also a combination of these letters. (e.g: cs,si,ca,iq,qa,csq,acs,csia ..etc). The order of the letters does not matter. My problem... (2 Replies)
Discussion started by: Vaisakh P
2 Replies

2. Shell Programming and Scripting

Small script for website links and regular expressions

Need a help with a simple(i hope) script that would get a website location from stdin and then check all the links that site contains for some random regular expression ,and then save the links name and the expression found in some random file.Any help would be really helpfull. Considerin i`m... (5 Replies)
Discussion started by: Zbunce
5 Replies

3. Shell Programming and Scripting

Regular Expressions

what elements does " /^/ " match? I did the test which indicates that it matches single lowercase character like 'a','b' etc. and '1','2' etc. But I really confused with that. Because, "/^abc/" matches strings like "abcedf" or "abcddddee". So, what does caret ^ really mean? Any response... (2 Replies)
Discussion started by: DavidHe
2 Replies

4. Shell Programming and Scripting

Need help with Regular Expressions

Hi, In ksh, I am trying to compare folder names having -141- in it's name. e.g.: 4567-141-8098 should match this expression '*-141-*' but, -141-2354 should fail when compared with '*-141-*' simlarly, abc should fail when compared with '*-141-*' I tried multiple things but nevertheless,... (5 Replies)
Discussion started by: jidsh
5 Replies

5. Shell Programming and Scripting

regular expressions using perl script

i have a set of regular expressions. The words in the regular expression should be used to replace the i/p with hyphens '---'. i need perl script to evaluate these regular expression. the words in the regexes when found in the i/p file should be replaced with hyphens '---'. the set of regular... (3 Replies)
Discussion started by: Sgiri1
3 Replies

6. UNIX for Advanced & Expert Users

Regular Expressions

Hi, below is a piece of code written by my predecessor at work. I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code. It is really a tough time for me to figure out all the regular expressions. Please shed some light on the regular expressions... (3 Replies)
Discussion started by: ramky79
3 Replies

7. UNIX for Dummies Questions & Answers

Execute a shell script using regular expressions

I am have a configuration script that my shell script uses. There is a regular expression defined for the input file. How do execute the shell script and pass the name of the input file using a regular expression. I would greatly appreciate some help. If you could point my to a website that... (1 Reply)
Discussion started by: supergirl3954
1 Replies

8. Shell Programming and Scripting

using regular expressions in c shell control structure

i cant get around using regular expressions in if/else statements. it simply doesnt give me the right results. i've tried using switch/case but that is just as sh!tty as well. (pardon my french but im getting frustrated with c shell..only reason why im writing in it is because it's a hwk... (3 Replies)
Discussion started by: ballazrus
3 Replies

9. Programming

regular expressions in c++

How do I use the regular expressions in c++? (2 Replies)
Discussion started by: szzz
2 Replies

10. UNIX for Dummies Questions & Answers

Regular Expressions in shell scripts <yawn>

Quite possibly a simple problem who's answer is evading me: I am trying to write a sh shell script, part of which is *logically* trying to do the following: if ]; then ... fi if ]; then ... else ... fi Where the 1st condition is looking for a hostname passed as $1, the second... (3 Replies)
Discussion started by: sam_pointer
3 Replies
Login or Register to Ask a Question