redirecting the output of aspell


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users redirecting the output of aspell
# 1  
Old 07-07-2006
redirecting the output of aspell

Hi,

I have 2 identical servers both running aspell but for some reason I can't redirect the output to a file on one of them. This is what I'm trying to do:

echo feck | aspell -l > errors.txt

On one machine this works fine but the other it doesn't (the file is created but it is empty). However if I just type:

echo feck | aspell -l

it correctly displays the word feck as being misspelt. I've done an strace and the machine that works shows this at the end:

fstat64(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
munmap(0x4033c000, 4046848) = 0
munmap(0x40718000, 159744) = 0
munmap(0x4001b000, 12288) = 0
write(1, "feck\n", 5) = 5
_exit(0) = ?

the machine that doesn't works shows this:
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
munmap(0x4033b000, 4046848) = 0
munmap(0x40717000, 159744) = 0
_exit(0) = ?

If I leave off the >errors.txt is does this:
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
write(1, "feck\n", 5feck
) = 5
munmap(0x4033b000, 4046848) = 0
munmap(0x40717000, 159744) = 0
_exit(0) = ?

Finally I've tried these:
$ echo feck >errors.out
works
$ echo feck | aspell -l | cat
fails

Can someone please help as I've now spent a day and a half on this?

Thanks,

Lee

P.S. Incase they're needed, here are the versions I'm using:

aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell .33.7 alpha)

cat /etc/redhat-release
Red Hat Linux Advanced Server release 2.1AS (Pensacola)

Last edited by leekb; 07-07-2006 at 09:55 AM.. Reason: Providing version numbers
# 2  
Old 07-07-2006
maybe:
Code:
echo feck | aspell -l  2>&1 | tee > errors.txt

It's most likely something defined in the local environment on the server that doesn't play nicely.

try
Code:
set > `hostname`.lis

on both machines, then do a diff on the two files.

Depending on your shell you may need to use a different command to display all of th environment variables....
# 3  
Old 07-07-2006
unfortunately echo feck | aspell -l 2>&1 | tee > errors.txt didn't work either.

I've done a differences on the outputs of set and the only thing it threw up were the ones you'd expect to be different: SUDO_UID, PPID, HOSTNAME and then a few extras on the box that works to do with IBM director so I don't think it's the local environment that's causing the problem.

I've also compared /usr/lib/aspell, /usr/share/aspell and also the binary and they all identical.
# 4  
Old 07-07-2006
Last thought - Are process limits (open files, number of processes allowed, etc)
very different on the "bad" box from the "good" box - for the user you are experimenting with?

The only way to compare binaries is with a check sum, most likely. Did you compare ldd outputs?

I'd try to remove and reinstall aspell - I'm guessing it's a Linux box - if it's feasable.
# 5  
Old 07-08-2006
Quick reply; Try
echo feck | aspell -l 2>&1 | tee > errors.txt 2>&1
# 6  
Old 07-10-2006
tried that and unfortunately it didn't work either
# 7  
Old 07-10-2006
I uninstalled aspell and reinstalled and that didn't work either. I then had a quick go at installing the latest version of aspell but haven't got gcc installed. Tried installing that and found a load of incompatible dependancies. Then searching on the aspell website I came across a reference to the -a parameter. Interesingly this does actually send the results to stdout rather than the mysterious stream that -l sends them to. The output is a little different so I'll have to change my program to cater for it but that's okay by me. Thanks for everyone's help. FYI: here's the new results:

echo feck | aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell .33.7 alpha)
& feck 11 0: fleck, Deck, deck, fuck, Beck, Keck, Peck, beck, heck, neck, peck

This works regardless of whether I put > errors.txt or not.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirecting output using if with awk

I have this line were I am selecting some fields from one file and creating a new file for the selected data. awk -F "\"*,\"*" '{print $1"," $2}' folderone/list.txt > folderone/qlist.txt This works, but then from this new file I want it to create a new file where it separates data: $2 >5 it... (2 Replies)
Discussion started by: rluna
2 Replies

2. Shell Programming and Scripting

Redirecting output to file

Hi, I have created script which redirect the output to file.I am able to get the output in file but not in the format. Output :Content of the log which have 10 -15 lines. Actal :Line1 ..Line 2Line3 Line4 Line 5 Expected:Line1 Line 2 Line3 Please... (7 Replies)
Discussion started by: karthik771
7 Replies

3. Shell Programming and Scripting

Redirecting the output

For example, if we run the below command, symcfg list -thin -pool , results in an output most of the times and if the out is generated i'm able to redirect the output to a file. but sometimes it doesnt result any output and even though the output is being redirected, i can see "No Thin Pools "... (2 Replies)
Discussion started by: web2moha
2 Replies

4. Shell Programming and Scripting

redirecting output using if-then-else in awk

I am trying to filter records based on number of "|", delimiter in my application. If number of "|" is greater than 14 its a bad record, else its a good record. I have to redirect output to two different files based on the if-then-else evaluation in AWK. if number of “|” in file_0 > 14 ... (2 Replies)
Discussion started by: siteregsam
2 Replies

5. UNIX for Dummies Questions & Answers

redirecting script output

Hello, I am interested in taking the output from a script i wrote and using it as input to a different script i wrote. So for example i want to take the output from program2 and use it as a parameter for program1. I didnt think i could use the >> symbols because i think that is just for .txt... (4 Replies)
Discussion started by: GmGeubt
4 Replies

6. Shell Programming and Scripting

Redirecting output to file

Hi, Below is the whole string which is to be redirected to the new file. su - oracle -c "exp $user/$pass file=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.dmp log=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.log tables=table1,table2 statistics=none" ... (3 Replies)
Discussion started by: milink
3 Replies

7. Shell Programming and Scripting

help redirecting output from mailbot

Hello...I'm having problems redirecting output from a script from a mailbot. It is a perl script that has the email sent to op_shipper piped into it. I am receiving the email with sendmail and here is what my alias looks like for the script am I having problems with in /etc/aliases: ... (3 Replies)
Discussion started by: kuliksco
3 Replies

8. UNIX for Dummies Questions & Answers

Redirecting 'find' output...

Hi all, why does one version of this command work but not the other? - This file already exists with 644 mod permissions - I am logged in as d269836, no su rights. - Box is 'SunOS' running bash I think; but runs ksh scripts OK. This one works: find /users/d269836 -type f -name "*.txt"... (6 Replies)
Discussion started by: dan-e
6 Replies

9. Shell Programming and Scripting

Redirecting OUTPUT

Hi, I want to move the output of a command/script to a file as well as to to be displayed on stdout. Can anybody help me in this. Thanks in advace .. -Chanakya M (1 Reply)
Discussion started by: Chanakya.m
1 Replies

10. UNIX for Dummies Questions & Answers

Redirecting the startup output

Is there any way to redirect the output of the startup of a sun E250. Im basically trying to troubleshoot some init scripts and it would be useful to have a log of the startup output. (3 Replies)
Discussion started by: blakmk
3 Replies
Login or Register to Ask a Question