Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-23-2008, 04:50 PM
|
#1
|
|
LQ Newbie
Registered: Oct 2008
Posts: 3
Rep:
|
Modifying Functions
How do I modify a funtion that takes a directory name as an argument and writes to standard output the maximum of the lengths of all filenames in that directory to descend all subdirectories of the named directory recursively and to find the maximum length of any filename in that hierarchy?
|
|
|
|
10-23-2008, 05:28 PM
|
#2
|
|
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524
Rep:
|
You change it into
Code:
find ${the_directory} -printf '%f\n' | wc -L
and change the rest of the program into a shell script  See the man pages for find and wc to learn how and why it works.
Quote:
|
How do I modify a funtion
|
Well, what language are you using? Also, out of curiousity, why? To help you, it might be useful for us to know a bit on your programming background, just so we know roughly how much to explain and how much to assume you already know.
|
|
|
|
10-24-2008, 09:03 PM
|
#3
|
|
LQ Newbie
Registered: Oct 2008
Posts: 3
Original Poster
Rep:
|
My Programming Background
Most of my programming background is in Microsoft (I know, dirty word in this world). To be honest, I need help understanding what I am doing in Linux enough to pass the last class I have before graduating in December. Any help is GREATLY appreciated!!
Thanks,
Ebostic711
|
|
|
|
10-25-2008, 05:31 AM
|
#4
|
|
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524
Rep:
|
Is your question answered? Otherwise, please answer my previous questions: which language, and why? Also, please provide the code snippet you want changed.
|
|
|
|
10-26-2008, 06:58 PM
|
#5
|
|
LQ Newbie
Registered: Oct 2008
Posts: 3
Original Poster
Rep:
|
RE: My Question
Quote:
Originally Posted by jonaskoelker
Is your question answered? Otherwise, please answer my previous questions: which language, and why? Also, please provide the code snippet you want changed.
|
No, my question hasn't been answered. As far as the language I am using I don't know. We are used Fedora Core8. And, I am trying to change the code snippet that was the original to create it (I don't know that either). Can you help? Or,is there a web site that I can go to that will explain the basics of scripting for this program?
|
|
|
|
10-26-2008, 07:20 PM
|
#6
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
Quote:
Originally Posted by ebostic711
No, my question hasn't been answered. As far as the language I am using I don't know. We are used Fedora Core8. And, I am trying to change the code snippet that was the original to create it (I don't know that either). Can you help? Or,is there a web site that I can go to that will explain the basics of scripting for this program?
|
You want to modify a function, but you haven't shown us any code. If it exists, we need to see it. If it doesn't, then we must assume that you wanted to say "create", and not "modify".
You want us to give you info about how to change I don't know what function, in I don't know what language. I wonder if you really think we can give out feedback with the amount of info you gave us.
Show us the function, the original code snippet, and be clear about what modifications need to be done, and maybe someone around will recognize the language and give you some pointers, or direct you to some tutorials. But we can't direct you to tutorials about something that we don't even know what is.
Last edited by i92guboj; 10-26-2008 at 07:21 PM.
|
|
|
|
10-27-2008, 11:40 AM
|
#7
|
|
Member
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Rep:
|
Quote:
Originally Posted by ebostic711
How do I modify a funtion that takes a directory name as an argument and writes to standard output the maximum of the lengths of all filenames in that directory to descend all subdirectories of the named directory recursively and to find the maximum length of any filename in that hierarchy?
|
Do you have a specific function that you need to modify?
If so
What is the function you are trying to modify?
|
|
|
|
10-28-2008, 01:39 PM
|
#8
|
|
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524
Rep:
|
OP: Ask your TA.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:40 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|