[arch-general] pacman.log has no timezone information in timestamp

Tinu Weber takeya at bluewin.ch
Sat Mar 2 09:03:27 UTC 2019

On Sat, Mar 02, 2019 at 01:43:10 +0000, Juha Kankare via arch-general wrote:
> For some reason, ' $ TZ=UTC sudo pacman' and '$ sudo TZ=UTC pacman' both 
> work, but '$ alias pacman="TZ=UTC pacman"' and then '$ sudo pacman' 
> doesn't, even though (from what I know) it should be practically equal 
> to '$ sudo TZ=UTC pacman'. Not sure why, but it was worth a shot.

If you run a command with sudo, it won't expand aliases. You'd need to
define an alias for sudo itself (see alias(1p), EXAMPLES section,
example 4).

Then again, I'm not sure if defining an alias for sudo is considered
good practice. Also, for this matter, a wrapper script would be cleaner,
as it doesn't depend on which user is running it, in which environment,
in which shell, etc.

> Any other way to automate this TZ=UTC for pacman so you don't have to
> type it every time. Maybe a wrapper script aliased to "upacman" or
> something?

Something like /usr/local/bin/pacman that calls /usr/bin/pacman, for
instance (or more robustly, ../../bin/pacman relative to itself, to also
account for cases where root is a subdirectory/mountpoint) comes to
mind as a not-too-ugly workaround.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20190302/47a20007/attachment.sig>

More information about the arch-general mailing list