bug-coreutils
[Top][All Lists]
Advanced

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

Re: avoid mkdir/selinux failure when mknod is a shell built-in


From: Jim Meyering
Subject: Re: avoid mkdir/selinux failure when mknod is a shell built-in
Date: Wed, 16 Apr 2008 14:57:10 +0200

Thomas Schwinge <address@hidden> wrote:
> On Wed, Apr 16, 2008 at 02:30:57PM +0200, Jim Meyering wrote:
...
>> My first reaction was "great! that looks much better".
>> Unfortunately, the technique doesn't work with that shell:
>>
>>   openbsd$ ./mknod --version|head -1
>>   mknod (GNU coreutils) 6.10.188-7cb24
>>   openbsd$ PATH=. /bin/sh -c 'mknod --version'|head -1
>
>                                 ^ exec?

Of course.  My stand-alone example was wrong.
However, with 'exec' it fails the same way.

On the other hand, Eric's suggestions to use nice or nohup do work:

  $ PATH=. /bin/sh -c 'exec mknod --version'|head -1
  /bin/sh: mknod: --: unknown option
  /bin/sh: mknod: usage: mknod [-m mode] name [b | c] major minor
  /bin/sh: mknod: usage: mknod [-m mode] name p
  $ PATH=. /bin/sh -c '(exec mknod --version)' | head -1
  /bin/sh: mknod: --: unknown option
  /bin/sh: mknod: usage: mknod [-m mode] name [b | c] major minor
  /bin/sh: mknod: usage: mknod [-m mode] name p
  $ PATH=. /bin/sh -c 'nice mknod --version' | head -1
  mknod (GNU coreutils) 6.10.188-7cb24
  $ PATH=. /bin/sh -c 'nohup mknod --version' | head -1
  nohup: ignoring input and redirecting stderr to stdout
  mknod (GNU coreutils) 6.10.188-7cb24
  $

So I'll go with nice.
Thanks, Eric!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]