Bug 228123

Summary: date command gives wrong time when used in tcsh aliases
Product: Base System Reporter: Dan MacDonald <allcoms>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: 11.1-RELEASE   
Hardware: Any   
OS: Any   

Description Dan MacDonald 2018-05-10 17:24:45 UTC
I am running a fully up to date FreeBSD 11.1-RELEASE-p10 / amd64 and I am using tcsh for my shell. I created a couple of aliases to create date and timestamped ZFS snapshots and added them to my ~/.cshrc but the time output by my custom `date` format command is always behind the actual time. If I run my aliases straight after booting, they are only about 1m behind but the longer my machine is turned on, the more the time in the aliases gets out of sync with the actual time.

If I run just `date` or if I run the date command using my formatted output from the command line, I get the correct time. It is only when date is executed via my aliases that the time falls behind.

One of my aliases that exhibits this issue:

alias zsd	 sudo zfs snapshot -r data/media@`date +%d-%m-%Y-%T`