LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2007, 09:09 PM   #1
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Rep: Reputation: 30
Linux Script Exercises


-hey guys where can i find linux script exercises....to practice my linux scripting...
 
Old 01-16-2007, 09:24 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
We talkin' shell scripting, Perl scripting, HTML scripting, what?

If you administer your own system, chances are you'll run across occasions for shell scripting quickly enough.

I recommand that you learn Perl. Pick up _Programming Perl_ (an O'Reilly book); it's excellent. Or google for

Perl tutorial

and find several tutorials, of varying quality.

If you decide to learn Perl, I have a couple of exercises for you. You'll learn quite a bit about Linux/Unix and Perl if you do them.

Exercise one:

Write a script which traverses all the directories on your system (starting with / and working down) and outputs the full pathname of each file among the XXX largest. Define a way that your Perl script will let the user pick XXX at runtime. (If, for example, he says "10", output the 10 largest files.)

Exercise two:

Write a script which traverses all the directories on your system (starting with / and working down) and outputs the full pathname of each regular file which has not been read for XXX days.

Have fun!
 
Old 01-16-2007, 09:25 PM   #3
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
"recommand" should be "recommend"

furrfu
 
Old 01-16-2007, 11:24 PM   #4
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
-sorry i forgot its shell scripting....
-which is better anyway shell scripting or perl scripting?
 
Old 01-17-2007, 01:52 AM   #5
Cirdan
Member
 
Registered: Nov 2005
Distribution: Arch Linux
Posts: 84

Rep: Reputation: 15
Perl scripting is more powerful. Shell scripting is basically a list of commands to give to the terminal to run. Perl is an actually programming language somewhat.
 
Old 01-17-2007, 02:28 AM   #6
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
Quote:
Perl scripting is more powerful. Shell scripting is basically a list of commands to give to the terminal to run. Perl is an actually programming language somewhat.
- so what is highly suggested for a like me shell scripting or perl scripting
 
Old 01-18-2007, 07:13 AM   #7
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
Get into shell scripting first. But then be sure you also learn to program in Perl. You won't regret it.
 
Old 01-18-2007, 07:17 PM   #8
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Original Poster
Rep: Reputation: 30
-where can i find a good tutorial in perl scripting?
 
Old 01-19-2007, 06:06 AM   #9
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
http://learn.perl.org

For more sources, google:

Perl tutorial

If you find youself spending a lot of time with Perl, get the O'Reilly book _Programming Perl_.
 
  


Reply



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
Java Exercises itd_pac Programming 1 08-14-2006 08:27 AM
new to linux, exhaustive command line exercises rajneesh_mangla Linux - Software 2 02-08-2006 02:56 PM
trying out exercises from Kernighan and Ritchie dvm Programming 2 11-22-2004 07:07 PM
exercises for learning c... Sky Programming 25 07-18-2002 01:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:05 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
Open Source Consulting | Domain Registration