[ale] Dumb Shell Scripting Question.....

Joe Sechman joe.sechman at gmail.com
Thu Dec 9 14:16:29 EST 2004


I was wondering if it was possible to echo the name of a running
command interactively in the shell to where the output contains the
name of the command and the resulting command output - resulting  in a
log of commands (w/the help of tee, etc...) that were run matched with
their output.

For example:

$ ls -la | tee -a myoutput
ls -la | tee -a myoutput:
total 32
drwxrwxr-x    2 sechmanj sechmanj     4096 Oct 21 13:32 .
drwx------   29 sechmanj sechmanj     4096 Dec  9 10:08 ..
-rw-rw-r--    1 sechmanj sechmanj      579 Jun 14 13:43 franki.c
-rw-rw-r--    1 sechmanj sechmanj      190 May 11  2004 example.txt
...

$ cat test | tee -a myoutput
cat test | tee -a myoutput:
This is a test file

$ cat myoutput
ls -la | tee -a myoutput:
total 32
drwxrwxr-x    2 sechmanj sechmanj     4096 Oct 21 13:32 .
drwx------   29 sechmanj sechmanj     4096 Dec  9 10:08 ..
-rw-rw-r--    1 sechmanj sechmanj      579 Jun 14 13:43 franki.c
-rw-rw-r--    1 sechmanj sechmanj      190 May 11  2004 example.txt
...
cat test | tee -a myoutput:
This is a test file

I've got the sense that I'm missing something blaringly
obvious.......Thanks in advance for any help!!

-- 
Joe Sechman
Unix / Linux Systems Administrator
RLU: #367555
http://counter.li.org



More information about the Ale mailing list