mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
scripts: factor out benchmarks and run further with ./eeval and common_bench_cmd
This commit is contained in:
18
eeval
18
eeval
@@ -1,4 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# echo and eval
|
||||
a=
|
||||
while getopts a OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
# Append to file instead of overwriting.
|
||||
a=-a
|
||||
;;
|
||||
?)
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$(($OPTIND - 1))"
|
||||
cmd="$1"
|
||||
echo "$cmd" | tee -a "${2:-/dev/null}"
|
||||
outfile="${2:-/dev/null}"
|
||||
echo "$cmd" | tee $a "$outfile"
|
||||
eval "$cmd"
|
||||
exit "$?"
|
||||
|
||||
Reference in New Issue
Block a user