Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Bash: Tee command doesnt print the dates in log function when called

  • 16-09-2021 08:51AM
    #1
    Registered Users, Registered Users 2 Posts: 5,763 ✭✭✭


    function log {

        echo "[$(date --rfc-3339=seconds)]: $*" | tee -a $testout_file

    }


    Doesnt output the date stuff. Im newish to tee, any tips im sure its something simple



Comments

  • Registered Users, Registered Users 2 Posts: 1,110 ✭✭✭Skrynesaver


    The shell expansion is not interpolated, try the following instead

    echo  \[$(date --rfc-3339=seconds)\]\: $* | tee -a $testout_file
    

    



Advertisement