bash - In Linux, how to redirect wall output in script to file? -
i'm trying log events in bash script following lines:
#!/bin/bash { ... echo "photo backup finished on $(date)" | wall ... } &>> "/var/log/$(basename "$0").log" &
however, in log file, corresponding line instead appears as:
wall: cannot tty name: inappropriate ioctl device
it seems wall outputs can't directed file.
how can work? (be able post wall , log message file)
one possibility use "tee -a" instead of ">>". example:
echo "hello world"|tee -a myfile.log|wall
Comments
Post a Comment