Re: pacman.log has no timezone information in timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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.

Best,
Tinu

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux