find - Bash redirection stops working ( using "set -x" debug outputs ) -
my main script starts :
#!/bin/bash set -x #debug avec des stacktrace partout set -u #erreur si variable non définie export >$rep_frontal/env.bash trace=$rep_frontal/traces.log exec >$trace 2>&1 source $rep_frontal/lib.sh where rep_frontal environment variable. contains path main , lib.sh both are.
i can see outputs, including debugging (set -x) redirected file trace.log
but have line of code breaks behavior. used call function defined in sourced lib.sh file, have tried put somewhere directly in file : line seems break behavior of redirecting trace.log.
here line :
(find $rep_frontal -type f -print0 | xargs -0 -n 10 -p 4 dos2unix 2>/dev/null) here tail of trace.log looks :
+ mkdir -p /somedir/a/b/ + find /path/in/rep_frontal/variable -type f -print0 + xargs -0 -n 10 -p 4 dos2unix and : end of file..
removing redirection line not :
(find $rep_frontal -type f -print0 | xargs -0 -n 10 -p 4 dos2unix ) #same result line can guess what's wrong here ? thank you
that worked : don't know why appreciate knowing. accepted answer should go on explain.
find $rep_frontal -type f -print0 | xargs -0 -n 10 -p 4 dos2unix > /dev/null 2&1 the parenthesis useless, pointed out jens in comments.
Comments
Post a Comment