You are not logged in.

#1 2009-11-06 22:06:54

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

[Solved] Hmm, I don't get what 'install -D' does

I really have no idea what the install '-D' flag does.  I understand the -m flag changes the file (-)mode 644, 755, but I have no idea what the -D does or when to use it.  From the man page:

       -D     create all leading components of DEST except the last, then copy
              SOURCE to DEST

Before I get the 'it does exactly what it says it does'  could someone please put it in different terms?  When and why would I use this?

Last edited by Gen2ly (2009-11-06 23:00:19)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#2 2009-11-06 22:18:20

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [Solved] Hmm, I don't get what 'install -D' does

install file /path/to/file
vs.
install -D file /path/to/

That's all.


1000

Offline

#3 2009-11-06 22:18:22

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: [Solved] Hmm, I don't get what 'install -D' does

It creates the directory path that is the prefix of DEST. So:

$ touch stuff
$ install stuff some/where/else
install: cannot create regular file `some/where/else': No such file or directory
$ install -D stuff some/where/else
$ ls -R some
some:
where

some/where:
else

Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#4 2009-11-06 22:59:43

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [Solved] Hmm, I don't get what 'install -D' does

Ahhh, looked over a couple PKGBUILDS and missed that.  Thanks for the information.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

Board footer

Powered by FluxBB