How to use Bash to create a folder if it doesn't already exist?












150















#!/bin/bash
if [!-d /home/mlzboy/b2c2/shared/db]; then
mkdir -p /home/mlzboy/b2c2/shared/db;
fi;


This doesn't seem to work. Can anyone help?










share|improve this question




















  • 3





    Why do you have semicolons?

    – ADTC
    Apr 13 '16 at 11:05






  • 1





    The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

    – Andreas Riedmüller
    Jun 27 '18 at 7:26
















150















#!/bin/bash
if [!-d /home/mlzboy/b2c2/shared/db]; then
mkdir -p /home/mlzboy/b2c2/shared/db;
fi;


This doesn't seem to work. Can anyone help?










share|improve this question




















  • 3





    Why do you have semicolons?

    – ADTC
    Apr 13 '16 at 11:05






  • 1





    The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

    – Andreas Riedmüller
    Jun 27 '18 at 7:26














150












150








150


23






#!/bin/bash
if [!-d /home/mlzboy/b2c2/shared/db]; then
mkdir -p /home/mlzboy/b2c2/shared/db;
fi;


This doesn't seem to work. Can anyone help?










share|improve this question
















#!/bin/bash
if [!-d /home/mlzboy/b2c2/shared/db]; then
mkdir -p /home/mlzboy/b2c2/shared/db;
fi;


This doesn't seem to work. Can anyone help?







bash folder






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 5 '11 at 11:27









templatetypedef

267k69679897




267k69679897










asked Feb 5 '11 at 11:25









mlzboymlzboy

5,811236591




5,811236591








  • 3





    Why do you have semicolons?

    – ADTC
    Apr 13 '16 at 11:05






  • 1





    The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

    – Andreas Riedmüller
    Jun 27 '18 at 7:26














  • 3





    Why do you have semicolons?

    – ADTC
    Apr 13 '16 at 11:05






  • 1





    The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

    – Andreas Riedmüller
    Jun 27 '18 at 7:26








3




3





Why do you have semicolons?

– ADTC
Apr 13 '16 at 11:05





Why do you have semicolons?

– ADTC
Apr 13 '16 at 11:05




1




1





The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

– Andreas Riedmüller
Jun 27 '18 at 7:26





The ; token is a command separator, so is newline. As then is a separate command, the preceding semicolon is needed to be be able to write it in the same line. The semicolons after mkdir and fi are superflous.

– Andreas Riedmüller
Jun 27 '18 at 7:26












6 Answers
6






active

oldest

votes


















240














First, in bash "[" is just a command, which expects string "]" as a last argument, so the whitespace before the closing bracket (as well as between "!" and "-d" which need to be two separate arguments too) is important:



if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
mkdir -p /home/mlzboy/b2c2/shared/db;
fi


Second, since you are using -p switch to mkdir, this check is useless, because this is what does in the first place. Just write:



mkdir -p /home/mlzboy/b2c2/shared/db;


and thats it.






share|improve this answer





















  • 1





    Note: the -p flag causes any parent directories to be created if necessary.

    – Danijel
    May 15 '18 at 8:03






  • 4





    My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

    – Ben Kushigian
    Nov 16 '18 at 2:11



















84














There is actually no need to check whether it exists or not. Since you already wants to create it if it exists , just mkdir will do



mkdir -p /home/mlzboy/b2c2/shared/db





share|improve this answer



















  • 2





    Note: the -p flag causes any parent directories to be created if necessary.

    – Danijel
    May 15 '18 at 8:03





















54














Simply do:



mkdir /path/to/your/potentially/existing/folder


mkdir will throw an error if the folder already exists. To ignore the errors write:



mkdir -p /path/to/your/potentially/existing/folder


No need to do any checking or anything like that.





For reference:



-p, --parents no error if existing, make parent directories as needed http://man7.org/linux/man-pages/man1/mkdir.1.html






share|improve this answer





















  • 2





    The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

    – BeeOnRope
    Nov 15 '18 at 23:26



















18














You need spaces inside the [ and ] brackets:



#!/bin/bash
if [ ! -d /home/mlzboy/b2c2/shared/db ]
then
mkdir -p /home/mlzboy/b2c2/shared/db
fi





share|improve this answer































    17














    Cleaner way, exploit shortcut evaluation of shell logical operators. Right side of the operator is executed only if left side is true.



    [ ! -d /home/mlzboy/b2c2/shared/db ] && mkdir -p /home/mlzboy/b2c2/shared/db





    share|improve this answer



















    • 11





      mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

      – Davide Orazio Montersino
      Jul 25 '14 at 7:46













    • I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

      – ADTC
      Apr 13 '16 at 11:11






    • 2





      Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

      – ADTC
      Apr 13 '16 at 11:23



















    4














    I think you should re-format your code a bit:



    #!/bin/bash
    if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
    mkdir -p /home/mlzboy/b2c2/shared/db;
    fi;





    share|improve this answer
























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4906579%2fhow-to-use-bash-to-create-a-folder-if-it-doesnt-already-exist%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      240














      First, in bash "[" is just a command, which expects string "]" as a last argument, so the whitespace before the closing bracket (as well as between "!" and "-d" which need to be two separate arguments too) is important:



      if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
      mkdir -p /home/mlzboy/b2c2/shared/db;
      fi


      Second, since you are using -p switch to mkdir, this check is useless, because this is what does in the first place. Just write:



      mkdir -p /home/mlzboy/b2c2/shared/db;


      and thats it.






      share|improve this answer





















      • 1





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03






      • 4





        My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

        – Ben Kushigian
        Nov 16 '18 at 2:11
















      240














      First, in bash "[" is just a command, which expects string "]" as a last argument, so the whitespace before the closing bracket (as well as between "!" and "-d" which need to be two separate arguments too) is important:



      if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
      mkdir -p /home/mlzboy/b2c2/shared/db;
      fi


      Second, since you are using -p switch to mkdir, this check is useless, because this is what does in the first place. Just write:



      mkdir -p /home/mlzboy/b2c2/shared/db;


      and thats it.






      share|improve this answer





















      • 1





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03






      • 4





        My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

        – Ben Kushigian
        Nov 16 '18 at 2:11














      240












      240








      240







      First, in bash "[" is just a command, which expects string "]" as a last argument, so the whitespace before the closing bracket (as well as between "!" and "-d" which need to be two separate arguments too) is important:



      if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
      mkdir -p /home/mlzboy/b2c2/shared/db;
      fi


      Second, since you are using -p switch to mkdir, this check is useless, because this is what does in the first place. Just write:



      mkdir -p /home/mlzboy/b2c2/shared/db;


      and thats it.






      share|improve this answer















      First, in bash "[" is just a command, which expects string "]" as a last argument, so the whitespace before the closing bracket (as well as between "!" and "-d" which need to be two separate arguments too) is important:



      if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
      mkdir -p /home/mlzboy/b2c2/shared/db;
      fi


      Second, since you are using -p switch to mkdir, this check is useless, because this is what does in the first place. Just write:



      mkdir -p /home/mlzboy/b2c2/shared/db;


      and thats it.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 25 '16 at 4:17









      pcambra

      240111




      240111










      answered Feb 5 '11 at 11:48









      Maxim SloykoMaxim Sloyko

      9,56543045




      9,56543045








      • 1





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03






      • 4





        My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

        – Ben Kushigian
        Nov 16 '18 at 2:11














      • 1





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03






      • 4





        My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

        – Ben Kushigian
        Nov 16 '18 at 2:11








      1




      1





      Note: the -p flag causes any parent directories to be created if necessary.

      – Danijel
      May 15 '18 at 8:03





      Note: the -p flag causes any parent directories to be created if necessary.

      – Danijel
      May 15 '18 at 8:03




      4




      4





      My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

      – Ben Kushigian
      Nov 16 '18 at 2:11





      My god, I've never knew that "[" is a command. This explains so many of my problems... Easily the most useful thing I've ever read on StackOverflow.

      – Ben Kushigian
      Nov 16 '18 at 2:11













      84














      There is actually no need to check whether it exists or not. Since you already wants to create it if it exists , just mkdir will do



      mkdir -p /home/mlzboy/b2c2/shared/db





      share|improve this answer



















      • 2





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03


















      84














      There is actually no need to check whether it exists or not. Since you already wants to create it if it exists , just mkdir will do



      mkdir -p /home/mlzboy/b2c2/shared/db





      share|improve this answer



















      • 2





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03
















      84












      84








      84







      There is actually no need to check whether it exists or not. Since you already wants to create it if it exists , just mkdir will do



      mkdir -p /home/mlzboy/b2c2/shared/db





      share|improve this answer













      There is actually no need to check whether it exists or not. Since you already wants to create it if it exists , just mkdir will do



      mkdir -p /home/mlzboy/b2c2/shared/db






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Feb 5 '11 at 12:00









      kurumikurumi

      20.1k33344




      20.1k33344








      • 2





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03
















      • 2





        Note: the -p flag causes any parent directories to be created if necessary.

        – Danijel
        May 15 '18 at 8:03










      2




      2





      Note: the -p flag causes any parent directories to be created if necessary.

      – Danijel
      May 15 '18 at 8:03







      Note: the -p flag causes any parent directories to be created if necessary.

      – Danijel
      May 15 '18 at 8:03













      54














      Simply do:



      mkdir /path/to/your/potentially/existing/folder


      mkdir will throw an error if the folder already exists. To ignore the errors write:



      mkdir -p /path/to/your/potentially/existing/folder


      No need to do any checking or anything like that.





      For reference:



      -p, --parents no error if existing, make parent directories as needed http://man7.org/linux/man-pages/man1/mkdir.1.html






      share|improve this answer





















      • 2





        The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

        – BeeOnRope
        Nov 15 '18 at 23:26
















      54














      Simply do:



      mkdir /path/to/your/potentially/existing/folder


      mkdir will throw an error if the folder already exists. To ignore the errors write:



      mkdir -p /path/to/your/potentially/existing/folder


      No need to do any checking or anything like that.





      For reference:



      -p, --parents no error if existing, make parent directories as needed http://man7.org/linux/man-pages/man1/mkdir.1.html






      share|improve this answer





















      • 2





        The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

        – BeeOnRope
        Nov 15 '18 at 23:26














      54












      54








      54







      Simply do:



      mkdir /path/to/your/potentially/existing/folder


      mkdir will throw an error if the folder already exists. To ignore the errors write:



      mkdir -p /path/to/your/potentially/existing/folder


      No need to do any checking or anything like that.





      For reference:



      -p, --parents no error if existing, make parent directories as needed http://man7.org/linux/man-pages/man1/mkdir.1.html






      share|improve this answer















      Simply do:



      mkdir /path/to/your/potentially/existing/folder


      mkdir will throw an error if the folder already exists. To ignore the errors write:



      mkdir -p /path/to/your/potentially/existing/folder


      No need to do any checking or anything like that.





      For reference:



      -p, --parents no error if existing, make parent directories as needed http://man7.org/linux/man-pages/man1/mkdir.1.html







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 16 '18 at 10:49

























      answered Feb 25 '13 at 13:56









      AutomaticoAutomatico

      6,78324888




      6,78324888








      • 2





        The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

        – BeeOnRope
        Nov 15 '18 at 23:26














      • 2





        The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

        – BeeOnRope
        Nov 15 '18 at 23:26








      2




      2





      The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

      – BeeOnRope
      Nov 15 '18 at 23:26





      The argument -p doesn't exactly ignore errors: it invokes a different mode where any path components that don't exist are created (and hence it is not an error if happens that zero need to be created). The behavior is different since it will create components other than the last one, which may or not be desirable.

      – BeeOnRope
      Nov 15 '18 at 23:26











      18














      You need spaces inside the [ and ] brackets:



      #!/bin/bash
      if [ ! -d /home/mlzboy/b2c2/shared/db ]
      then
      mkdir -p /home/mlzboy/b2c2/shared/db
      fi





      share|improve this answer




























        18














        You need spaces inside the [ and ] brackets:



        #!/bin/bash
        if [ ! -d /home/mlzboy/b2c2/shared/db ]
        then
        mkdir -p /home/mlzboy/b2c2/shared/db
        fi





        share|improve this answer


























          18












          18








          18







          You need spaces inside the [ and ] brackets:



          #!/bin/bash
          if [ ! -d /home/mlzboy/b2c2/shared/db ]
          then
          mkdir -p /home/mlzboy/b2c2/shared/db
          fi





          share|improve this answer













          You need spaces inside the [ and ] brackets:



          #!/bin/bash
          if [ ! -d /home/mlzboy/b2c2/shared/db ]
          then
          mkdir -p /home/mlzboy/b2c2/shared/db
          fi






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 5 '11 at 11:29









          dogbanedogbane

          193k66323374




          193k66323374























              17














              Cleaner way, exploit shortcut evaluation of shell logical operators. Right side of the operator is executed only if left side is true.



              [ ! -d /home/mlzboy/b2c2/shared/db ] && mkdir -p /home/mlzboy/b2c2/shared/db





              share|improve this answer



















              • 11





                mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

                – Davide Orazio Montersino
                Jul 25 '14 at 7:46













              • I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

                – ADTC
                Apr 13 '16 at 11:11






              • 2





                Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

                – ADTC
                Apr 13 '16 at 11:23
















              17














              Cleaner way, exploit shortcut evaluation of shell logical operators. Right side of the operator is executed only if left side is true.



              [ ! -d /home/mlzboy/b2c2/shared/db ] && mkdir -p /home/mlzboy/b2c2/shared/db





              share|improve this answer



















              • 11





                mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

                – Davide Orazio Montersino
                Jul 25 '14 at 7:46













              • I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

                – ADTC
                Apr 13 '16 at 11:11






              • 2





                Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

                – ADTC
                Apr 13 '16 at 11:23














              17












              17








              17







              Cleaner way, exploit shortcut evaluation of shell logical operators. Right side of the operator is executed only if left side is true.



              [ ! -d /home/mlzboy/b2c2/shared/db ] && mkdir -p /home/mlzboy/b2c2/shared/db





              share|improve this answer













              Cleaner way, exploit shortcut evaluation of shell logical operators. Right side of the operator is executed only if left side is true.



              [ ! -d /home/mlzboy/b2c2/shared/db ] && mkdir -p /home/mlzboy/b2c2/shared/db






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jun 9 '14 at 14:30









              plesivplesiv

              6,32332031




              6,32332031








              • 11





                mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

                – Davide Orazio Montersino
                Jul 25 '14 at 7:46













              • I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

                – ADTC
                Apr 13 '16 at 11:11






              • 2





                Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

                – ADTC
                Apr 13 '16 at 11:23














              • 11





                mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

                – Davide Orazio Montersino
                Jul 25 '14 at 7:46













              • I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

                – ADTC
                Apr 13 '16 at 11:11






              • 2





                Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

                – ADTC
                Apr 13 '16 at 11:23








              11




              11





              mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

              – Davide Orazio Montersino
              Jul 25 '14 at 7:46







              mmh, not cleaner: just shorter. It's difficult to understand the meaning of such a statement if you come across it.

              – Davide Orazio Montersino
              Jul 25 '14 at 7:46















              I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

              – ADTC
              Apr 13 '16 at 11:11





              I like this, although the -p argument makes the check unnecessary. You can still use it when you don't want to use -p, that is when you don't want all the parent directories to be created automatically.

              – ADTC
              Apr 13 '16 at 11:11




              2




              2





              Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

              – ADTC
              Apr 13 '16 at 11:23





              Actually it's even shorter to write [ -d /path/to/dir ] || mkdir /path/to/dir .. right side is executed when the left side is false.

              – ADTC
              Apr 13 '16 at 11:23











              4














              I think you should re-format your code a bit:



              #!/bin/bash
              if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
              mkdir -p /home/mlzboy/b2c2/shared/db;
              fi;





              share|improve this answer




























                4














                I think you should re-format your code a bit:



                #!/bin/bash
                if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
                mkdir -p /home/mlzboy/b2c2/shared/db;
                fi;





                share|improve this answer


























                  4












                  4








                  4







                  I think you should re-format your code a bit:



                  #!/bin/bash
                  if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
                  mkdir -p /home/mlzboy/b2c2/shared/db;
                  fi;





                  share|improve this answer













                  I think you should re-format your code a bit:



                  #!/bin/bash
                  if [ ! -d /home/mlzboy/b2c2/shared/db ]; then
                  mkdir -p /home/mlzboy/b2c2/shared/db;
                  fi;






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 5 '11 at 11:30









                  ivyivy

                  5,12112647




                  5,12112647






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4906579%2fhow-to-use-bash-to-create-a-folder-if-it-doesnt-already-exist%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      List item for chat from Array inside array React Native

                      Thiostrepton

                      Caerphilly