LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-23-2008, 05:50 PM   #1
ebostic711
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Rep: Reputation: 0
Question 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?
 
Old 10-23-2008, 06:28 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
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.
 
Old 10-24-2008, 10:03 PM   #3
ebostic711
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Original Poster
Rep: Reputation: 0
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
 
Old 10-25-2008, 06:31 AM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Is your question answered? Otherwise, please answer my previous questions: which language, and why? Also, please provide the code snippet you want changed.
 
Old 10-26-2008, 07:58 PM   #5
ebostic711
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Question RE: My Question

Quote:
Originally Posted by jonaskoelker View Post
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?
 
Old 10-26-2008, 08:20 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by ebostic711 View Post
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 08:21 PM.
 
Old 10-27-2008, 12:40 PM   #7
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Quote:
Originally Posted by ebostic711 View Post
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?
 
Old 10-28-2008, 02:39 PM   #8
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
OP: Ask your TA.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: OpenOffice.org Calc functions, part 1: Understanding functions LXer Syndicated Linux News 0 03-31-2007 01:01 PM
Slackpkg: missing something in /usr/libexec/slackpkg/functions.d/dialog-functions.sh michelino Slackware 4 03-20-2007 01:22 PM
Converting php5 socket functions to php3 socket functions mrobertson Programming 0 06-23-2005 10:11 AM
modifying slackware monkeymartin Slackware 4 07-15-2003 03:32 AM
pointers to functions/member functions champ Programming 2 03-28-2003 07:22 PM


All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration