The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Test-driving OpenOffice.org 3.0 iBot UNIX and Linux RSS News 0 04-04-2008 08:10 AM
Simple test driving me mad! alarmcall Shell Programming and Scripting 6 10-27-2003 07:29 AM
unix driving me crazy Tendernisin UNIX for Dummies Questions & Answers 1 11-29-2001 07:38 PM
New to this, pleas help... Sear999 UNIX for Dummies Questions & Answers 3 04-10-2001 05:12 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-13-2008
Registered User
 

Join Date: Apr 2008
Posts: 2
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 06:12 AM. Reason: added code tags
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0