Pleas help..this is driving me crazy


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pleas help..this is driving me crazy
# 1  
Old 05-13-2008
Pleas help..this is driving me crazy

Hi, I've created a script in csh that takes a file and checks it for mispelled words. Im almost done but I need to do two more things but I need help.

First, when displaying an incorrect word to the user, I need to show the line of the input file that contains the word.
Second,if the user gives a replacement word, then I need to actually replace the word in the input file.

heres my code ...........

Code:
#!/bin/csh
#script that will spell check a file

set array = (`ispell -l -p $HOME/memory.txt < $1`)

set correct = ""
set incorrect = ""

foreach word ( $array )
  echo $word is mispelled. Press "enter" to keep this spelling, or type a correction
  set correction=$<
  if($correction == "") then
     echo $word >> "$HOME/memory.txt"
  else
     set correct = ( $correct $correction )
     set incorrect = ( $incorrect $word  )
  endif
end

echo "MISPELLED"'-'"CORRECTIONS"
@ counter = 1
foreach $word ( $correct )
  echo $incorrect[$counter]        $correct[$counter]
   @ counter++
end


PLEASE HELP ME!!!

Last edited by Yogesh Sawant; 05-13-2008 at 10:12 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX/Linux/Distributions - driving me crazy...

Hello there, first of all: I do not want to become a hacker. you cannot do that. you cannot learn that from a book. Don't think I'm some kind of a script-kiddie. now that's settled let's start. I've been trying around with a lot of OS lately. I have backtrack5 installed on my notebook,... (10 Replies)
Discussion started by: Dr. Nick
10 Replies

2. What is on Your Mind?

Here's To The Crazy One

Please excuse my indulgence. Thank you MG Siegler and Steve Jurvetson. But most importantly, thank you Steve Jobs. 8rwsuXHA7RA The world has lost a genius. (1 Reply)
Discussion started by: Scott
1 Replies

3. Homework & Coursework Questions

Crazy Dots

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a script called DOTS that will display the horizontal or vertical number of dots if the first argument... (3 Replies)
Discussion started by: pchelpmtl
3 Replies

4. UNIX for Dummies Questions & Answers

Variable with @ sign is driving me crazy

Ok so I am working on a command that is going to do a Dig @ a certain IP address which is enclosed in a variable. Now I thought I had this figure out because it works. The problem is that it does not ALWAYS work. the variable is IP=192.168.1.1 the commands I have tried are dig... (2 Replies)
Discussion started by: MrEddy
2 Replies

5. Shell Programming and Scripting

Finger has gone crazy

Two things : On the first place i am really desperate, on the second i am about to throw my laptop away to the recycle bin in a while. Ok now that i expressed my feeling let me describe you this mad situation. Code: print $1; ("finger -m " $1 "| head -1") | getline userinfo print... (6 Replies)
Discussion started by: beatblaster666
6 Replies

6. Shell Programming and Scripting

Escape Characters are driving me crazy!

Hi everyone, Is there anywhere I can find a complete table of all characters that must be escaped by the various UNIX shells and scripting languages? It seems every command/shell/scripting language has different rules about what characters must be escaped. I do a lot of searching and... (3 Replies)
Discussion started by: troym72
3 Replies

7. Shell Programming and Scripting

PERL cgi script... extra character driving me crazy

I'm using a PERL cgi script that uses rrdtool to make graphs. I can't get the syntax correct to use a degree sign (alt+0176 like this °) and also using a variable. If I use single quotes, I can't call the variable. If I use double quotes, there is an extra symbol (Â) before the ° which goes... (2 Replies)
Discussion started by: audiophile
2 Replies

8. UNIX for Dummies Questions & Answers

unix driving me crazy

:( :confused: what is performed by the following unix command: grep -v Jane project1.txt and grep ' 5\..' janet.txt (1 Reply)
Discussion started by: Tendernisin
1 Replies

9. UNIX for Dummies Questions & Answers

New to this, pleas help...

hello, i'm totally new to this, just trying to start learing unix. I have 2 questions really... First, What's the difference between Linux and Unix? Second, Where can I find/buy the Unix os? I appriciate anyone that can help me :) (3 Replies)
Discussion started by: Sear999
3 Replies
Login or Register to Ask a Question