Bug 1411711 - Localized tool 'time' doesn't support options what described in manual
Summary: Localized tool 'time' doesn't support options what described in manual
Alias: None
Product: Fedora
Classification: Fedora
Component: time
Version: 25
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-10 11:14 UTC by Alexandr Kondratev
Modified: 2017-01-10 14:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-01-10 14:52:07 UTC
Type: Bug

Attachments (Terms of Use)

Description Alexandr Kondratev 2017-01-10 11:14:43 UTC
Description of problem:
$ echo $LANG
$ time -a -o /tmp/test.res -- ./stack_test &> /tmp/test.res

real    0m1.423s
user    0m0.009s
sys     0m0.007s
$ cat /tmp/test.res
bash: -a: команда не найдена...
It means "-a: command not found"

Version-Release number of selected component (if applicable):
$ LANG=en rpm -qi time
Name        : time
Version     : 1.7
Release     : 49.fc24
Architecture: x86_64
Install Date: Tue Jan 10 13:55:54 2017
Group       : Applications/System
Size        : 47702
License     : GPLv2+
Signature   : RSA/SHA256, Fri Apr  1 18:01:23 2016, Key ID 4089d8f2fdb19c98
Source RPM  : time-1.7-49.fc24.src.rpm
Build Date  : Fri Feb  5 11:26:33 2016
Build Host  : buildvm-02-nfs.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://www.gnu.org/software/time/
Summary     : A GNU utility for monitoring a program's use of system resources
Description :
The GNU time utility runs another program, collects information about
the resources used by that program while it is running, and displays
the results.

The package came with system upgrade from fc24.
It wasn't upgraded during fedora upgrade fc24 to fc25.
time-1.7...fc24 is the latest available in fedora repositories.

How reproducible:
Set LANG to any other than en_EN.
I'm sure what exactly ru_RU locale gives a fail.

Steps to Reproduce:

Actual results:
A failure.

Expected results:
Unlocalized output into the file.

Additional info:

Comment 1 Petr Pisar 2017-01-10 12:11:04 UTC
What shell do you execute the time command from? I suspect that you invoke a shell built-in command, not /usr/bin/time from time package. In case of bash:

$ type -a time
time is a shell keyword

$ help time
time: time [-p] pipeline
    Report time consumed by pipeline's execution.

Hence tries to execute "-a -o /tmp/test.res -- ./stack_test" command.

Comment 2 Alexandr Kondratev 2017-01-10 14:27:38 UTC
$ LANG=en_US type -a time
time is a shell keyword
time is /usr/bin/time

If I understood correctly, variables in prefix run command in */bin/ instead of built-in, right?

BTW, thanks a lot.
So, this issue not a bug and could be closed.


Comment 3 Petr Pisar 2017-01-10 14:52:07 UTC
Yes, if you specify the command with a path, e.g. /usr/bin/time, then the shell will execute a program from that file. If you specify the command without a path, e.g. time, your shell will use its internal implementation that does not support the "-a" option.

Note You need to log in before you can comment on or make changes to this bug.