Advertisement

07.12.2008 at 11:13PM PDT, ID: 23560405 | Points: 75
[x]
Attachment Details

Pattern matching in shell script

Asked by prasen in KornShell (ksh), IBM AIX Unix, Bourne-Again Shell (bash)

Tags:

I need to write a script which can do the followings ---
1> check if the line has ---> class (followed by tab or spaces) class name shouldn't start with lower case letters or numerics, it should only start with Upper case followed by lower case alphabets.
like, class MyClass
not class myClass

2> all the variables should start with lower case first letter, like
 String myString
or int myInt
or long myLong
or double myDouble
or boolean myBoolean

I want to do it with sed, I'm trying to do this, but its not working, pls help.
s/class .*'[^a-z0-9]'.*/\/\/ERR: class name should start with Upper case*** /g

Regards
prasenStart Free Trial
[+][-]07.12.2008 at 11:20PM PDT, ID: 21991477

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2008 at 01:06AM PDT, ID: 21991666

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2008 at 04:19AM PDT, ID: 21992018

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.13.2008 at 04:57AM PDT, ID: 21992158

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2008 at 06:47AM PDT, ID: 21992517

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.13.2008 at 07:08AM PDT, ID: 21992633

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 07:42AM PDT, ID: 21998487

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628