[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

unix shell script about converting files name to lower case

Asked by zahmadian in Unix Systems Programming

Tags: shell, unix, script, case, lower

Hi Experts,

I am trying to write a shell script for converting upper case names of .cpp & .h files into lower case,
my script is checking if the file is not directory, if it was directory it will print a warning,
then it will check if the file name is not in lower case already, if it is, then it prints a warning message
and it checks also if there exists a file with same lower case name, if there was it will print a warning again,
at the end it will convert the name of the file into lower case.

could any one tell me that if this script is good enough and working , and also I thought in some places I need to quite the program but I dont know how to quite in Unix...





foreach file (*.cpp *.h)                          // loop for .cpp & .h file
 if (-d $file )then                                    // if the file is directory
echo 'Warning: $file is Directory'             // print warning message
elseif (-f $file) then                                // else if it is file
set var=$file                                          // set file to variable
// convert name of variable into lowercase and then give its value to newvar
set varnew=`echo var | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`  
if ($var==$varnew) then                         // compare the name when converted to lower case and the name at the beggining
echo '$file: file name aready in lower case!'         // if same prints warning
// quite   from the program                              
endif      // end if
if (-e $varnew) then         // check if any file with same name in lowercase exists
echo '$file = with lower case in exist, cant convert to lower case'              // print warning
//quite
endif
mv $file $varnew        // move value of varnew to file (change its name??)
endif        
end

 
[+][-]01/15/06 12:11 AM, ID: 15703811Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 12:38 AM, ID: 15703854Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 12:41 AM, ID: 15703859Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 12:44 AM, ID: 15703866Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 01:04 AM, ID: 15703904Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Unix Systems Programming
Tags: shell, unix, script, case, lower
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 3
Solution Grade: A
 
[+][-]01/15/06 01:38 AM, ID: 15703971Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 11:06 AM, ID: 15705690Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 12:48 PM, ID: 15706195Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 01:03 PM, ID: 15706275Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 01:19 PM, ID: 15706361Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 01:26 PM, ID: 15706391Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 05:01 PM, ID: 15707383Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 08:14 PM, ID: 15708073Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/06 10:13 PM, ID: 15708451Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 10:17 PM, ID: 15708466Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/15/06 10:22 PM, ID: 15708482Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/16/06 03:02 AM, ID: 15709274Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/16/06 08:19 AM, ID: 15711851Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/06 11:55 AM, ID: 15713715Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/16/06 12:03 PM, ID: 15713787Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89