I have found a part of script like this In xx.sh:
BUILD_BOOT=.
mkdir -p $BUILD_BOOT
Can anybody help to explain what's the script above for as the directory parameter is .
?
The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md .
The mkdir command in Linux/Unix allows users to create or make new directories. mkdir stands for “make directory.” With mkdir , you can also set permissions, create multiple directories (folders) at once, and much more.
Use the mkdir command to create one or more directories specified by the Directory parameter. Each new directory contains the standard entries dot (.)
The mkdir command creates directories. This command can create multiple directories at once as well as set the permissions for the directories.
-p
is short for --parents
- it creates the entire directory tree up to the given directory.
E.g., suppose there are no directories in your current directory. If you execute:
mkdir a/b/c
It will fail, since you do not have an a
subdirectory.
On the other hand
mkdir -p a/b/c
Will create the entire structure - a/b/c
mkdir -p
means: create the directory and, if required, all parent directories. The fact that this makes little sense when the path is specified as .
, so the current working directory, does not change this. Most likely the line where the path is defined is meant to be adapted as required.
In general: consult the linux manual pages for questions about commands and their options like this: man mkdir
. A great source of information!
See mkdir
.
It creates all the intermediate directories on the path to the final directory that do not already exist (as well as the final directory), and doesn't fail if the target directory already exists.
In context, it is pointless; if the BUILD_ROOT
is the current directory, it already exists. At some time, the BUILD_ROOT
must have been a longer path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With