Bug#663421: debianutils: 'which time' reports '/usr/bin/time', rather than Bash reserved word
I see an error in my previous message: I see it as system-level problem -- two components (/bin/bash and /usr/bin/which) are using the same English word (time) in the same or similar contexts. /usr/bin/which should be /usr/bin/time. David -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#663421: debianutils: 'which time' reports '/usr/bin/time', rather than Bash reserved word
On Sat, Mar 10, 2012 at 10:08:33PM -0800, David Christensen wrote: It appears that 'time' is broken. It would be better if 'which' reported that 'time' is provided by Bash, similar to Bash's 'type' shell builtin command: There is no way /usr/bin/which can know that without it being hardcoded. What do you suggest? -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#663421: debianutils: 'which time' reports '/usr/bin/time', rather than Bash reserved word
On 03/11/2012 07:07 AM, Clint Adams wrote: On Sat, Mar 10, 2012 at 10:08:33PM -0800, David Christensen wrote: It appears that 'time' is broken. It would be better if 'which' reported that 'time' is provided by Bash, similar to Bash's 'type' shell builtin command: There is no way /usr/bin/which can know that without it being hardcoded. What do you suggest? I see it as system-level problem -- two components (/bin/bash and /usr/bin/which) are using the same English word (time) in the same or similar contexts. Ideas: 1. /bin/bash renames it's time keyword (--time?) so as not to conflict with /usr/bin/time or any other program. 2. /usr/bin/bash disables it's time keyword when /usr/bin/time is installed. 3. /bin/bash delegates to /usr/bin/time, when /usr/bin/time is installed. 4. /usr/bin/time is renamed (gnutime? gtime? plus manual pages, etc.) so as not to conflict with /bin/bash or any other shell (or program?). 5. /usr/bin/time is eliminated from the system. 6. /usr/bin/time is assimilated into /bin/bash, and /usr/bin/time is eliminated from the system. 7. /usr/bin/which delegates its functionality to the shell, when the shell provides such (/bin/bash type in the case of Bash; I don't know if the other shells have equivalents). 8. The package manager knows about the time conflict when installing /bin/bash, /usr/bin/time, and /usr/bin/which, informs the administrator, and offers options: a. Install/ remove packages so that only one time is installed (/bin/bash or /usr/bin/time). b. Install work-around's (such as 4, above). c. Installs both packages anyway (administrator must deal with conflict manually). My preference would be to implement both #1 and #4. So, perhaps this bug report should be moved to those packages... In the mean time, my solution is to use /bin/bash type rather than /usr/bin/which. David -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#663421: debianutils: 'which time' reports '/usr/bin/time', rather than Bash reserved word
Package: debianutils Version: 3.4 Severity: normal 'time' is a program that the 'which' program can find: $ which time /usr/bin/time But, 'time' is also a Bash reserved word: $ man bash | grep 'time reserved word' If the time reserved word precedes a pipeline, the elapsed as well as If the user does not know about the Bash 'time' reserved word, confusion results: $ time echo 'foo' foo real0m0.000s user0m0.000s sys 0m0.000s $ man time | grep . | head TIME(1) TIME(1) NAME time - run programs and summarize system resource usage SYNOPSIS time [ -apqvV ] [ -f FORMAT ] [ -o FILE ] [ --append ] [ --verbose ] [ --quiet ] [ --portability ] [ --format=FORMAT ] [ --output=FILE ] [ --version ] [ --help ] COMMAND [ ARGS ] DESCRIPTION time run the program COMMAND with any given arguments ARG When $ time -o foo.out echo 'foo' -bash: -o: command not found real0m0.001s user0m0.004s sys 0m0.000s $ time --help -bash: --help: command not found real0m0.001s user0m0.000s sys 0m0.000s It appears that 'time' is broken. It would be better if 'which' reported that 'time' is provided by Bash, similar to Bash's 'type' shell builtin command: $ type which which is hashed (/usr/bin/which) $ type type type is a shell builtin -- System Information: Debian Release: 6.0.4 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/dash Versions of packages debianutils depends on: ii libc6 2.11.3-3 Embedded GNU C Library: Shared lib ii sensible-utils0.0.4 Utilities for sensible alternative debianutils recommends no packages. debianutils suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org