Results 1 to 10 of 10

Thread: can anyone explain the command for me:)

  1. #1
    Join Date
    Feb 2013
    Beans
    6

    can anyone explain the command for me:)

    spell -x +ADDED_WORDS_LIST word_tmp_sort > word_tmp_spell

    I really want to know that should the file"ADDED_WORDS_LIST" exist already and has contents inside ,as I can't find a file with this name in my system. the command is a part of a sentence
    in a program
    Thanks a lot!

  2. #2
    Join Date
    Mar 2013
    Beans
    1

    Re: can anyone explain the command for me:)

    Take a look at this http://linuxcommand.org/index.php

  3. #3
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: can anyone explain the command for me:)

    It'll be a bit hard to figure this out without the rest of the script. As far as I know 'spell' is not a standard Linux command, and I'm guessing it's either a function or other script that's being called by the script you're looking at. I'm guessing it's probably another script that takes a couple arguments based on the '-x ADDED_WORDS_LIST' bit. Maybe add the whole script (please use the CODE tags so it's readable), and we'll have a better idea.

  4. #4
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: can anyone explain the command for me:)

    The -x option is ignored by GNU spell so that does nothing on a GNU/Linux system. The other parameters are filenames containing text to be spell-checked. These are not standard system files. The one with the '+' at the start does look odd but '+' is valid as the first character of a filename.

    So this command says, "Check the files '+ADDED_WORDS_LIST' and 'word_tmp_sort' and list any words that are not in the standard dictionary. Put the output into a file called 'word_tmp_spell'".
    Please create new threads for new questions.
    Please wrap code in code tags using the '#' button or enter it in your post like this: [code]...[/code].

  5. #5
    Join Date
    Feb 2013
    Beans
    6

    Re: can anyone explain the command for me:)

    Code:
    #!/site/bin/perl
    
    open(IN,"$ARGV[0]");
    open(OUT1, "> $ARGV[0]_words");
    open(OUT2, "> words_in_$ARGV[0]");
    while (<IN>) {
        $sentence = $_;
        print OUT1 "$sentence";
        print " sentence: $sentence";
        @words = split /\W/ , $sentence;
        open(TMP,"> word_tmp");
        foreach $word (@words) {
        $word =~ tr/[A-Z]/[a-z]/;
            print "     word $word \n";
            print TMP "$word\n";
        }
        close(TMP);
        system("sort -o word_tmp_sort word_tmp");
        system("spell -x +$ARGV[1] word_tmp_sort > word_tmp_spell");
        system("uniq word_tmp_spell > word_uniq");
        open(TMP1,"word_uniq");
        while (<TMP1>) {
        $_ =~ s/=//;
        print OUT1 "$_";
        print OUT2 "$_";
            print "$_";
        }
        close(TMP1);
        unlink(word_tmp_lower);
       unlink(word_tmp_spell);
        unlink(word_tmp);
        unlink(word_tmp_sort);
       unlink(word_uniq);
        print OUT1 "===\n";
    }
    close(IN);
    close(OUT1);
    close(OUT2);

    in fact , what I ask about is from a perl code with the name of 'sentence_words'(above is the code),system("spell -x +$ARGV[1] word_tmp_sort > word_tmp_spell")is a sentence among above.
    and the perl program which calls 'sentence_words' uses the following sentence to do that: system("perl sentence_words SENTENCES ADDED_WORDS_LIST"); I can find SENTENCES ,now ADDED_WORDS_LIST has also been found.

    So now the command can be translated into : spell -x +ADDED_WORDS_LIST word_tmp_sort > word_tmp_spell
    which means : words from 'word_tmp_sort' which are not literally in the spelling list are stored in file 'word_tmp_spell',and words present in ADDED_WORDS_LIST are removed from the output as additional correctly spelled words.


    but the system can not recongnize "+ADDED_WORDS_LIST", maybe it is because the code was written in a very old version of linux.

    Can someone tell me what I should do to realize the same function or the make it work under my system. Thanks so so much
    Last edited by warmsuns; March 8th, 2013 at 06:26 PM.

  6. #6
    Join Date
    Feb 2013
    Beans
    6

    Re: can anyone explain the command for me:)

    the link is very useful ,thanks

  7. #7
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: can anyone explain the command for me:)

    It's an old spell syntax from legacy versions of Unix: you can look it up in the SUSv2 or at the Heirloom Toolchest project.
    Last edited by schragge; March 7th, 2013 at 04:36 PM.

  8. #8
    Join Date
    Feb 2013
    Beans
    6

    Re: can anyone explain the command for me:)

    Quote Originally Posted by schragge View Post
    It's an old spell syntax from legacy versions of Unix: you can look it up in the SUSv2 or at the Heirloom Toolchest project.
    Thank you so much I will look into them Could please tell me since it is an old syntax ,How can I make the commnd work in my own system?
    Last edited by warmsuns; March 8th, 2013 at 06:02 PM.

  9. #9
    Join Date
    Feb 2013
    Beans
    6

    Re: can anyone explain the command for me:)

    Quote Originally Posted by schragge View Post
    It's an old spell syntax from legacy versions of Unix: you can look it up in the SUSv2 or at the Heirloom Toolchest project.
    Since it is an old version. Could you give me some idea how to make it work for my system now?

  10. #10
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: can anyone explain the command for me:)

    Here is the manual page of spell in Ubuntu. Compare for youself. There are also other spell-checking command line tools like aspell and hunspell.
    Last edited by schragge; March 8th, 2013 at 08:41 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •