LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-05-2004, 11:26 AM   #1
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
Simple Guide on creating text editor in shell.


Hello all, I have a small question.. For my uni project, i have this question. I don't want anyone to tell me how to do it (yet.. hehe j/k). I just want a small guide on what to use, and what shell programming language to use, etc... ill explain in more detail below the question.

Question:-----------------------------------------------------
Design, write, implement and test a Unix shell program to analyse a file that contains a piece of text, providing the user with the following statistics according to the user's choice:-

1- count of lines, words and characters
2- specific letter count (eg. how many 'e's)
3- specific word count (eg. how many 'and's)
4- sentence count
5- list of proper names appearing in the text
+ any other feathres that you consider useful.

Also, the completed system should include the following editing features:-
6- Change to a different text file
7- add extra lines to the text file
8- amend the text (eg. replace words)
9- list the text
10- exit system

The system should be menu-driven, initially prompting the user for the name of the text file, then offering a number of menu options, from which the user chooses. The apporpriate anaysis/edit is done, results displayed, and then the option list is presented again and again untill the user chooses to exit the system.

Remember, good programing style is required, using command procedures appropriately, comments, user friendly interface, etc..

--------------------------------------------------------------------------

After reading around, including this book i have "Linux Programming - A beginner's Guide' i found out that there are many scripting languages there; Bash, Tcsh, Gawk, Perl, TCL, TK, and so on..

My question is, which language (or languages) are best for my project? Do any of you have any tipps on how i should approach this, how i should sectionise it, how to start? etc..?

I have programmed in C, C++, and Java before (well.. a bit of batch programming in dos yeeears ago), but nothing related to *nix shell scripting.. But i'm prepared to, and have the time to read and study on what language(s) i must use.

And if anyone has any websites that are related to this, or contain good tutorials on anything that may help me, i'd appreciate it alot.

Thank you very much =)
Sam
 
Old 02-05-2004, 11:43 AM   #2
devinWhalen
Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Red Hat, openBSD,Mandrake,freeBSD,SunOS
Posts: 168

Rep: Reputation: 30
Hey,

I would suggest Perl....maybe just because I know it the best, but when I want to automate somthing that I can run from the command line I use perl. One reason is that it is easy to use and you can also use run bash command line commands from within perl. Plus since you have time to learn the language, it would be great excuse to learn perl which you can use to solve many other problems. It is great for web programming and it is similar to both PHP and bash, at least I found, that way you can make an easy transition into those other two languages...if you wanted to.

Just my 2 cents.

Here are some sites that I use or have used:
http://www.perl.com/pub/q/faqs
http://www.perldoc.com/perl5.6/
http://www.cs.cf.ac.uk/Dave/PERL/perl_caller.html
http://www.cpan.org/

Hope this helps!

Later
 
Old 02-06-2004, 02:37 AM   #3
james.zhang
LQ Newbie
 
Registered: Feb 2004
Location: China Hunan
Posts: 9

Rep: Reputation: 0
I would suggest bsh,csh,csh
 
  


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
A good text editor...this should be simple. TheMusicGuy Linux - Software 9 10-06-2004 01:16 AM
Good simple text editor like WinSyntax needed eBopBob Linux - Software 5 08-18-2004 04:15 PM
A simple text editor for .ps files satimis Linux - Software 13 08-12-2004 11:38 AM
Text editor in RH9 shell? deWin Linux - Newbie 15 03-07-2004 01:30 AM
Just a simple text editor fr0zen Linux - Software 6 12-22-2003 01:04 AM


All times are GMT -5. The time now is 03:03 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration