![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|