LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-30-2006, 06:38 AM   #1
Imiro
LQ Newbie
 
Registered: Sep 2002
Distribution: Fedora core 4
Posts: 17

Rep: Reputation: 0
accidental rename of *spell


Howdy,

i renamed this file by accident from /usr/bin to "m" and cant figure out which one it was. Anyone knows?
Maybe some of you could run a grep on your directory (i got fedora core4 ) for some of the stuff in this file?

Thanks.

Code:
#!/usr/bin/perl

#
# aspell-import -- Perl script to import old dictionaries
#
# This file is part of The New Aspell
# Copyright (C) 2001-2002 by Kevin Atkinson under the GNU LGPL
# license version 2.0 or 2.1.  You should have received a copy of the
# LGPL license along with this library if you did not you can find it
# at http://www.gnu.org/.



%abrv = qw( american     en
	    british      en
	    canadian     en
	    catala       ca
	    czech        cs
	    dansk        da
	    deutsch      de
	    ellhnika     el
	    english      en
	    espanol      es
	    esperanto    eo
	    francais     fr
	    german       de 
	    italian      it
	    liet         lt
	    nederlands   nl
	    norsk        no
	    polish       pl
	    portugues    pt
	    russian      ru
	    svenska      sv);

chdir $ENV{HOME};

foreach $file (<.ispell_*>, <.aspell.*.*>)
{
  $_ = $file;
  if    (/^.ispell_(.+)$/)            {$lang = $1; $type = 'ispell'}
  elsif (/^.aspell.(.+?).(per|pws)$/) {$lang = $1; $type = 'personal'}
  elsif (/^.aspell.(.+?).(prepl)$/)   {$lang = $1; $type = 'repl'}
  $abrv = $abrv{$lang};
  if (not defined $abrv) {
    print "Warning language \"$lang\" is not known\n" unless length $lang == 2;
    next;
  }
  open IN, $file;
  print "Processing \"~/$file\", lang = $abrv\n";
  if ($type eq 'ispell' || $type eq 'personal') {
    <IN> if $type eq 'personal';
    while (<IN>) {
      chop; 
      push @{$words{$abrv}{per}}, $_;
    }
  } elsif ($type eq 'repl') {
    $_ = <IN>;
    if (!/^personal\_repl\-1\.1/) {
      print "$file not in a supported format\n";
      next;
    }
    while (<IN>) {
      /^([^ ]+) (.+)\n$/ or die;
      push @{$words{$abrv}{repl}}, [$1,$2];
    }
  }
  close IN;
}

$SIG{PIPE} = 'IGNORE';

foreach $abrv (keys %words) {
  print "Merging $abrv\n";
  open P, "| aspell -a --lang=$abrv --sug-mode=ultra" or next;
  foreach (@{$words{$abrv}{per}}) {
    print P "* $_\n";
  }
  foreach (@{$words{$abrv}{repl}}) {
    print P "\$\$ra $_->[0],$_->[1]\n";
  }
  print P "#\n";
  close P;
}

Last edited by Imiro; 05-30-2006 at 06:53 AM.
 
Old 05-30-2006, 07:10 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
As indicated at the top, this program is called "aspell-import".
Quote:
#
# aspell-import -- Perl script to import old dictionaries
#
Read this comment line as:
name of script = aspell-import
description / purpose of script = Perl script to import old dictionaries


Verified the filename on my FC3 box and it really is "aspell-import", so you can safely rename it.

Last edited by timmeke; 05-30-2006 at 07:11 AM.
 
Old 05-30-2006, 09:03 AM   #3
Imiro
LQ Newbie
 
Registered: Sep 2002
Distribution: Fedora core 4
Posts: 17

Original Poster
Rep: Reputation: 0
Ok, i suspected this but wasnt sure. On reflection i could've looked into other files for comparison, but hey what're newbies for if not being newbs Anyway thanks for help!
 
  


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
Serious problem: Accidental chmod -R 777 / neocookie Linux - General 4 05-15-2006 03:41 AM
Accidental or Intentional Restart? MBH Slackware 1 09-17-2005 07:04 AM
accidental use of 'bind' command naedaneth Linux - Newbie 1 11-05-2004 03:22 PM
accidental mke2fs sarahan Linux - General 1 11-15-2003 04:58 AM
accidental deletion of /bin/ steve1394 Linux - Newbie 3 11-03-2003 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 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