Project

General

Profile

Actions

Bug #1239

closed

sleep should not be locale sensitive

Added by Rich Lowe almost 12 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2011-07-22
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

the ksh93-ized sleep tries to support fractions of a second, unfortunately it is locale sensitive (and probably incorrectly locale sensitive, too).

/bin/sleep 1.5 # sleeps for 1.5 seconds
LC_NUMERIC=de_DE.UTF-8 /bin/sleep 1.5 # sleeps for 1.5 seconds
LC_ALL=de_DE.UTF-8 /bin/sleep 1.5 # sleeps for 15 seconds
LC_ALL=de_DE.UTF-8 /bin/sleep 1,5 # sleeps for 1.5 seconds

It should probably not be locale sensitive. If it is going to be locale sensitive, it should probably be nice about LC_NUMERIC, rather than whatever it is doing instead.


Related issues

Related to illumos gate - Bug #6520: ksh: sleep could wait foreverClosed2015-12-18

Actions
Related to illumos gate - Feature #11876: Want a native sleepClosedRobert Mustacchi

Actions
Actions #1

Updated by Garrett D'Amore almost 12 years ago

Why shouldn't it be locale sensitive? I think it should respect the locale. If you want your script to work properly, put it into the C locale. (Of course people who expect fractional second sleeps in scripts are already probably locked into ksh93 and familiar with its warts.)

Actions #2

Updated by Rich Lowe almost 12 years ago

In answer to both points: fractional-sleep is available on most other platforms (FreeBSD seems to do it, OSX does do it, GNU does it). None of them respect the locale separator while doing it.

Try with /usr/gnu/bin/sleep, and de_DE.UTF-8 for instance.

Actions #3

Updated by Garrett D'Amore over 11 years ago

I wonder if a simple thing to do is just parse both , and . the same way here. Perhaps just looking for ispunct. That said, I care a lot less about ksh93's sleep... ksh93 is full of warts.

Actions #4

Updated by Rich Lowe over 11 years ago

/bin/sleep is the ksh93 sleep

Actions #5

Updated by Marcel Telka over 3 years ago

  • Related to Bug #6520: ksh: sleep could wait forever added
Actions #6

Updated by Robert Mustacchi over 3 years ago

  • Assignee set to Robert Mustacchi
Actions #7

Updated by Robert Mustacchi over 3 years ago

Actions #8

Updated by Robert Mustacchi over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Between both 11876 and 12069, I believe this can be put to rest.

Actions

Also available in: Atom PDF