/usr/bin/script doesn't wait for command to finish before exiting

Bug #264967 reported by Fergus Henderson on 2008-09-05
8
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Undecided
Unassigned

Bug Description

The script command fails to wait for the command that it is executing to finish.
For example, the command

  /usr/bin/script -c "sleep 1; echo foo" < /dev/null; echo bar

produces the output

  Script started, file is typescript
  Script done, file is typescript
  bar
  foo

and an empty "typescript" file, whereas the correct output should be

  Script started, file is typescript
  foo
  Script done, file is typescript
  bar

and the "typescript" file should contain "foo".

The attached patch fixes the problem.

Stefan Lesicnik (stefanlsd) wrote :

Hi Fergus,

Thanks for reporting this bug! We could fix it in Ubuntu, but i would really prefer if this could be fixed upstream as it is something that affects the functioning of the program.

Instructions on how to report bugs against util-linux-ng can be found here.
http://userweb.kernel.org/~kzak/util-linux-ng/

Thanks!

If you are unable to report it upstream for any reason, please let me know and I will see if I can assist.

Changed in util-linux:
status: New → Confirmed
Stefan Lesicnik (stefanlsd) wrote :

Hi Fergus,

Is the bug still an issue in the newer util-linux packages on Intrepid or Jaunty?

If so, we can look incorporate your patch if it is still applicable.

I don't know if it is still an issue on Intrepid or Jaunty. I don't
know how to access those.
If you do have access to a system running Intrepid or Jaunty, it's
very easy to test: just run the command

    /usr/bin/script -c "sleep 1; echo foo" < /dev/null; echo bar

and if the output is

   Script started, file is typescript
   Script done, file is typescript
   bar
   foo

then the bug is still present.

On Sat, Feb 21, 2009 at 6:42 AM, Stefan Lesicnik <email address hidden> wrote:
>
> Hi Fergus,
>
> Is the bug still an issue in the newer util-linux packages on Intrepid
> or Jaunty?
>
> If so, we can look incorporate your patch if it is still applicable.
>
> --
> /usr/bin/script doesn't wait for command to finish before exiting
> https://bugs.launchpad.net/bugs/264967
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in "util-linux" source package in Ubuntu: Confirmed
>
> Bug description:
> The script command fails to wait for the command that it is executing to finish.
> For example, the command
>
> /usr/bin/script -c "sleep 1; echo foo" < /dev/null; echo bar
>
> produces the output
>
> Script started, file is typescript
> Script done, file is typescript
> bar
> foo
>
> and an empty "typescript" file, whereas the correct output should be
>
> Script started, file is typescript
> foo
> Script done, file is typescript
> bar
>
> and the "typescript" file should contain "foo".
>
> The attached patch fixes the problem.

--
Fergus Henderson <email address hidden>

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers