Skip to content

Ganthark/teeoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

teeoe

Launch a script and redirect stderr and stdout to log files while still showing them in the terminal.
Any command with any number of parameters can be launched, stderr will be redirected to <cmd>.err and stdout to <cmd>.out (or specified paths with -e/-o). All output will still show in the terminal.

Usage

./teeoe [OPTION] command [args...] or teeoe [OPTION] command [args...]
A command must be provided. Shell builtins (e.g. history, cd) are not supported.

Options

  • -e Filename for the stderr redirection (default: ./<cmd>.err)
  • -o Filename for the stdout redirection (default: ./<cmd>.out)
  • -l Directory to write log files into (default: current directory)
  • -c Log the full command and timestamp at the top of the output file

Examples

teeoe grep "string" file.txt           # -> ./grep.out & ./grep.err
teeoe ./scripts/analysis/example.sh   # -> ./example.out & ./example.err
teeoe -l logs/ ./run.sh -v             # -> logs/run.out & logs/run.err
teeoe -l logs/ -e custom.err ./run.sh  # -> logs/run.out & custom.err
teeoe -c -l logs/ ./run.sh -v          # -> logs/run.out with command header & logs/run.err

The -c flag prepends the following header to the output file:

## Command: ./run.sh -v
## Date: 2026-03-25 14:32:01

<script output follows>

Arguments containing spaces are automatically wrapped in double quotes in the logged command, making it copy-pasteable.

Installation

Copy the teeoe file to your bin folder to execute it from anywhere, or run it directly with ./teeoe or bash teeoe.

About

Run a script and redirect stderr and stdout to log files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages