aoss is preventing file logging - logging argument commands

1

I am using an application which requires aoss. The results are required to be appended to a file. When I write these commands, the file is always empty:

aoss multimon -a DTMF | tee test.txt
aoss multimon -a DTMF > test.txt
aoss multimon -a DTMF >> test.txt

I believe the problem is that the file logging is pointing to aoss, rather than multimon -a DTMF, because the latter is actually an argument to the first. Is there a way to log the argument command instead, and yet still make the application runnable? (multimon -a DTMF is a terminal command using an application called multimon for DTMF decoding)

Ahmed Farid

Posted 2013-04-09T17:55:46.980

Reputation: 11

Answers

0

You could put the entire multimon command into a shell script and run that with aoss, or start another shell inside aoss:

(shell 1) $ aoss bash
(shell 2) $ multimon -a DTMF > test.txt
(shell 2) $ exit
(shell 1) $

CL.

Posted 2013-04-09T17:55:46.980

Reputation: 1 351

Neither of them worked sadly. This is what I wrote in the script: `#!/bin/sh

multimon -a DTMF > test.txt

exit

END`< – Ahmed Farid – 2013-04-09T19:16:57.057

0

The way aoss (a very short shell script) works is by preloading a special library using LD_PRELOAD. You can set this variable manually as well:

export LD_PRELOAD='/usr/$LIB/libaoss.so'
multimon --etc --etc --etc > test.txt

I believe the problem is that the file logging is pointing to aoss, rather than multimon -a DTMF, because the latter is actually an argument to the first.

That's not the cause. When process X opens or closes files (e.g. sets up redirection) and starts process Y, then the new process inherits the newly opened files. In other words, the shell just sets up redirection and runs the given aoss multimon... command, which inherits the redirected output from the shell. Likewise, when aoss does its thing and finally runs multimon -a DTMF, the multimon process inherits the same redirections from aoss.

user1686

Posted 2013-04-09T17:55:46.980

Reputation: 283 655

I was indeed looking for a similar solution to yours! However, export LD_PRELOAD='/usr/$LIB/libaoss.so' doesn't seem to fix the problem, as multimon -a DTMF still wouldn't work without aoss. I'm getting open: No such file or directory – Ahmed Farid – 2013-04-09T19:56:40.320

@AhmedFarid: Then read the aoss script and check what it does differently. – user1686 – 2013-04-09T19:57:22.180