We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
busybox and other cat tools do not have -v, added a check if the option is present
--- bin/execsnoop +++ bin/execsnoop @@ -58,6 +58,7 @@ tracing=/sys/kernel/debug/tracing flock=/var/tmp/.ftrace-lock; wroteflock=0 opt_duration=0; duration=; opt_name=0; name=; opt_time=0; opt_reexec=0 opt_argc=0; argc=8; max_argc=16; ftext= +VOPT=-v trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { @@ -156,6 +157,9 @@ else fi fi +# not all cat have -v, e.g busybox +echo test | cat -v 2> /dev/null | grep -q test || VOPT= + ### check permissions cd $tracing || die "ERROR: accessing tracing. Root user? Kernel has FTRACE? debugfs mounted? (mount -t debugfs debugfs /sys/kernel/debug)" @@ -224,10 +228,10 @@ warn "echo > trace" ( if (( opt_duration )); then # wait then dump buffer sleep $duration - cat -v trace + cat $VOPT trace else # print buffer live - cat -v trace_pipe + cat $VOPT trace_pipe fi ) | $awk -v o=$offset -v opt_name=$opt_name -v name=$name \ -v opt_duration=$opt_duration -v opt_time=$opt_time -v kname=$kname \ -v opt_reexec=$opt_reexec '
The text was updated successfully, but these errors were encountered:
No branches or pull requests
busybox and other cat tools do not have -v, added a check if the option is present
The text was updated successfully, but these errors were encountered: