Re: install(1) fails when reading from stdin

2017-09-28 Thread Matthias Kilian
On Tue, Sep 26, 2017 at 02:59:30PM +, Alfred Morgan wrote:
> Of course I can cat > a/b/myfile && chown me a/b/myfile && chgrp me
> a/b/myfile && chmod 0440 a/b/myfile but I know there is a stock command
> that fits the bill (install) but then I find to my disappointment that
> install can't accept stdin. What a let down and it feels anti-unix to me.

Please read the very last line of the DESCRIPTION section of
install(1) and then use install(1) followed by cat(1).

There's no point in adding features to  install(1).

Ciao,
Kili



Re: install(1) fails when reading from stdin

2017-09-27 Thread Alfred Morgan
> Not a bug

Call it a feature request then. I think that it is more useful and
consistent with other unix commands if install can source from stdin. cp
/dev/stdin /tmp/works as expected so I should be able to expect install do
the same.

> What problem are you trying to solve

I have run into this issue a few times before but in my particular case
right now I want to have several text notes with different configurations
that I can copy and paste on to typically fresh installed machines for
example:
# install -o me -g me -m 0644 ~me/.ssh/known_hosts << \.
foo bar
.
and if I have another config file I want to make I can use the above as a
template, copy-paste it, and I would only have to change the filename in
one place.
Of course I can cat > a/b/myfile && chown me a/b/myfile && chgrp me
a/b/myfile && chmod 0440 a/b/myfile but I know there is a stock command
that fits the bill (install) but then I find to my disappointment that
install can't accept stdin. What a let down and it feels anti-unix to me.

On Mon, Sep 25, 2017 at 9:45 PM Philip Guenther 
wrote:

> On Mon, 25 Sep 2017, Alfred Morgan wrote:
> > >Synopsis:  install(1) fails when reading from stdin
> > >Category:  usr.bin
> > >Environment:
> > System  : OpenBSD 6.1
> > Details : OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38
> > CEST 2017
> >  rob...@syspatch-61-amd64.openbsd.org:
> > /usr/src/sys/arch/amd64/compile/GENERIC.MP
> >
> > Architecture: OpenBSD.amd64
> > Machine : amd64
> > >Description:
> > install has trouble reading from stdin and there is no "-" file
> > argument to fall back on.
> > >How-To-Repeat:
> > $ echo test | install /dev/stdin /tmp/bug
> > install: /dev/stdin: Inappropriate file type or format
>
> That's not a documented and supported use of install(1).  "Not a bug"
>
> "What problem are you trying to solve"
>
>
> Philip Guenther
>
-- 
-alfred


Re: install(1) fails when reading from stdin

2017-09-25 Thread Philip Guenther
On Mon, 25 Sep 2017, Alfred Morgan wrote:
> >Synopsis:  install(1) fails when reading from stdin
> >Category:  usr.bin
> >Environment:
> System  : OpenBSD 6.1
> Details : OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38
> CEST 2017
>  rob...@syspatch-61-amd64.openbsd.org:
> /usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
> install has trouble reading from stdin and there is no "-" file
> argument to fall back on.
> >How-To-Repeat:
> $ echo test | install /dev/stdin /tmp/bug
> install: /dev/stdin: Inappropriate file type or format

That's not a documented and supported use of install(1).  "Not a bug"

"What problem are you trying to solve"


Philip Guenther



install(1) fails when reading from stdin

2017-09-25 Thread Alfred Morgan
>Synopsis:      install(1) fails when reading from stdin
>Category:  usr.bin
>Environment:
System  : OpenBSD 6.1
Details : OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38
CEST 2017
 rob...@syspatch-61-amd64.openbsd.org:
/usr/src/sys/arch/amd64/compile/GENERIC.MP

Architecture: OpenBSD.amd64
Machine : amd64
>Description:
install has trouble reading from stdin and there is no "-" file
argument to fall back on.
>How-To-Repeat:
$ echo test | install /dev/stdin /tmp/bug
install: /dev/stdin: Inappropriate file type or format
-- 
-alfred