spell

Hi,
I found the following line in a shell script.
$spell -a < $filename | \
grep -v '@(#)' | sed "s/\'//g" | \
awk '{ if (length($0) > 15 && length($2) > 2) print $2 }' | \
grep -vif $okaywords | \
grep '[[:lower:]]' | grep -v '[[:digit:]]' | sort -u | \
sed 's/^/ /' > $tempout

can anybody pls explain what each part of the above command does .

cheers
RRK

$spell seems to be a command (no way here to find what it is). The output of the $spell command is being sent to grep, which is used to remove all lines with '@(#)' in them. This is then sent to sed to strip single quotes. After that, the awk comes in, where if the entire input is longer than 15 char and the second field is longer than 2, then the second field is printed.

Then a grep is used to remove all lines that have words listed in file $okaywords (wonder why its called okaywords in that case...). Then keeping all lines with only lowercase letters, removing any lines that have numbers in them (0-9), and sort.

Finally sed is used to insert a space before every line and the output is written to a file.
I think I got everything...

Hi,:slight_smile:
Thank u .
Great explanation.
cheers
RRK