Advertisement

01.14.2006 at 11:18PM PST, ID: 21696979
[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: , , , ,

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

 Start Free Trial
[+][-]01.15.2006 at 12:11AM PST, ID: 15703811

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.2006 at 12:38AM PST, ID: 15703854

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.2006 at 12:41AM PST, ID: 15703859

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.2006 at 12:44AM PST, ID: 15703866

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.2006 at 01:04AM PST, ID: 15703904

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.2006 at 01:38AM PST, ID: 15703971

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.2006 at 11:06AM PST, ID: 15705690

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.2006 at 12:48PM PST, ID: 15706195

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.2006 at 01:03PM PST, ID: 15706275

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.2006 at 01:19PM PST, ID: 15706361

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.2006 at 01:26PM PST, ID: 15706391

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.2006 at 05:01PM PST, ID: 15707383

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.2006 at 08:14PM PST, ID: 15708073

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.2006 at 10:13PM PST, ID: 15708451

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.2006 at 10:17PM PST, ID: 15708466

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.2006 at 10:22PM PST, ID: 15708482

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.2006 at 03:02AM PST, ID: 15709274

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.2006 at 08:19AM PST, ID: 15711851

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.2006 at 11:55AM PST, ID: 15713715

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.2006 at 12:03PM PST, ID: 15713787

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...
20081112-EE-VQP-44