bash - Cannot redirect the ouput of hwclock -r command -
bash - Cannot redirect the ouput of hwclock -r command -
i implementing shell script , want analyse output shown hwclock -r (--show) command displays rtc time , date.
to tried things like: hwclock -r | grep -v "grep" | grep "error" > /dev/null see if error happened while reading rtc registers.
the problem output , forwarded console. tried forwards output file analyse content , tried utilize tee -a command direct output both console , file, no success.
is there solution or explanation happening hwclock -r command.
in advance give thanks you.
i solved forwarding error messages file create analysis.
hwclock -r 2> file.txt; grep -v "grep" | grep "error" > /dev/null
job.
you omitted file.txt
in first grep
.
if want check "error", not old bash
do, in shorter way:
hwclock -r |& grep error >/dev/null
bash shell hwclock
Comments
Post a Comment