Different behavior of mktemp Ubuntu 12.02 / Mint 9 Isadora












0















In a Bash script I use ImageMagick's convert command for doing some image processing.



I generate a temporal gif file for convert to write to.



I really need the file to have the .gif extension so convert knows that the destination file should be a gif file.



In Ubuntu 12.04 the following works fine:



mktemp /tmp/pre_XXXXXXXXXX.gif


But in Mint 9 Isadora I get the following error:



mktemp: too few X's in template 


No matter how many X's I throw at it, it yields the same error, which is only fixed when I delete the ".gif" suffix.



Why is that ? Isn't Mint based on Ubuntu ?










share|improve this question




















  • 1





    That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

    – terdon
    Aug 21 '13 at 15:20








  • 1





    To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

    – Junior Dussouillez
    Aug 21 '13 at 16:14













  • Crossposting? askubuntu.com/questions/335414/…

    – user15760
    Aug 21 '13 at 16:47
















0















In a Bash script I use ImageMagick's convert command for doing some image processing.



I generate a temporal gif file for convert to write to.



I really need the file to have the .gif extension so convert knows that the destination file should be a gif file.



In Ubuntu 12.04 the following works fine:



mktemp /tmp/pre_XXXXXXXXXX.gif


But in Mint 9 Isadora I get the following error:



mktemp: too few X's in template 


No matter how many X's I throw at it, it yields the same error, which is only fixed when I delete the ".gif" suffix.



Why is that ? Isn't Mint based on Ubuntu ?










share|improve this question




















  • 1





    That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

    – terdon
    Aug 21 '13 at 15:20








  • 1





    To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

    – Junior Dussouillez
    Aug 21 '13 at 16:14













  • Crossposting? askubuntu.com/questions/335414/…

    – user15760
    Aug 21 '13 at 16:47














0












0








0


0






In a Bash script I use ImageMagick's convert command for doing some image processing.



I generate a temporal gif file for convert to write to.



I really need the file to have the .gif extension so convert knows that the destination file should be a gif file.



In Ubuntu 12.04 the following works fine:



mktemp /tmp/pre_XXXXXXXXXX.gif


But in Mint 9 Isadora I get the following error:



mktemp: too few X's in template 


No matter how many X's I throw at it, it yields the same error, which is only fixed when I delete the ".gif" suffix.



Why is that ? Isn't Mint based on Ubuntu ?










share|improve this question
















In a Bash script I use ImageMagick's convert command for doing some image processing.



I generate a temporal gif file for convert to write to.



I really need the file to have the .gif extension so convert knows that the destination file should be a gif file.



In Ubuntu 12.04 the following works fine:



mktemp /tmp/pre_XXXXXXXXXX.gif


But in Mint 9 Isadora I get the following error:



mktemp: too few X's in template 


No matter how many X's I throw at it, it yields the same error, which is only fixed when I delete the ".gif" suffix.



Why is that ? Isn't Mint based on Ubuntu ?







ubuntu linux-mint tmp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 4 '17 at 14:41







Tulains Córdova

















asked Aug 21 '13 at 14:58









Tulains CórdovaTulains Córdova

5162723




5162723








  • 1





    That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

    – terdon
    Aug 21 '13 at 15:20








  • 1





    To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

    – Junior Dussouillez
    Aug 21 '13 at 16:14













  • Crossposting? askubuntu.com/questions/335414/…

    – user15760
    Aug 21 '13 at 16:47














  • 1





    That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

    – terdon
    Aug 21 '13 at 15:20








  • 1





    To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

    – Junior Dussouillez
    Aug 21 '13 at 16:14













  • Crossposting? askubuntu.com/questions/335414/…

    – user15760
    Aug 21 '13 at 16:47








1




1





That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

– terdon
Aug 21 '13 at 15:20







That should work, check if mktemp is defined as an alias or function: type mktemp. Also try mktemp --tmpdir pre_XXXXXXXXXX.gif

– terdon
Aug 21 '13 at 15:20






1




1





To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

– Junior Dussouillez
Aug 21 '13 at 16:14







To answer your question, yes Mint is based on Ubuntu. But your Mint version is quite old and is based on Ubuntu 10. Your command works on my Mint 15. Maybe the mktemp command changed between the Ubuntu 10 and 12, so between Mint 9 and the latest release of Mint.

– Junior Dussouillez
Aug 21 '13 at 16:14















Crossposting? askubuntu.com/questions/335414/…

– user15760
Aug 21 '13 at 16:47





Crossposting? askubuntu.com/questions/335414/…

– user15760
Aug 21 '13 at 16:47










2 Answers
2






active

oldest

votes


















2














mktemp is not a standard command and it differs wildly in functionality and options between systems (if the system even has an mktemp command). The only way to know what your mktemp accepts is to read its manual on the system in question.



Anyway, you don't need the .gif extension to tell imagemagick the result should be a gif file.



$ tmpfile=$(mktemp /tmp/pre_XXXXXX)
$ convert rose: "gif:$tmpfile"
$ file "$tmpfile"
/tmp/pre_MDDsuZ: GIF image data, version 89a, 70 x 46





share|improve this answer































    0














    The only difference i see is, it will create temp folder in /usr/tmp/...






    share|improve this answer








    New contributor




    Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      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: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f87638%2fdifferent-behavior-of-mktemp-ubuntu-12-02-mint-9-isadora%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      mktemp is not a standard command and it differs wildly in functionality and options between systems (if the system even has an mktemp command). The only way to know what your mktemp accepts is to read its manual on the system in question.



      Anyway, you don't need the .gif extension to tell imagemagick the result should be a gif file.



      $ tmpfile=$(mktemp /tmp/pre_XXXXXX)
      $ convert rose: "gif:$tmpfile"
      $ file "$tmpfile"
      /tmp/pre_MDDsuZ: GIF image data, version 89a, 70 x 46





      share|improve this answer




























        2














        mktemp is not a standard command and it differs wildly in functionality and options between systems (if the system even has an mktemp command). The only way to know what your mktemp accepts is to read its manual on the system in question.



        Anyway, you don't need the .gif extension to tell imagemagick the result should be a gif file.



        $ tmpfile=$(mktemp /tmp/pre_XXXXXX)
        $ convert rose: "gif:$tmpfile"
        $ file "$tmpfile"
        /tmp/pre_MDDsuZ: GIF image data, version 89a, 70 x 46





        share|improve this answer


























          2












          2








          2







          mktemp is not a standard command and it differs wildly in functionality and options between systems (if the system even has an mktemp command). The only way to know what your mktemp accepts is to read its manual on the system in question.



          Anyway, you don't need the .gif extension to tell imagemagick the result should be a gif file.



          $ tmpfile=$(mktemp /tmp/pre_XXXXXX)
          $ convert rose: "gif:$tmpfile"
          $ file "$tmpfile"
          /tmp/pre_MDDsuZ: GIF image data, version 89a, 70 x 46





          share|improve this answer













          mktemp is not a standard command and it differs wildly in functionality and options between systems (if the system even has an mktemp command). The only way to know what your mktemp accepts is to read its manual on the system in question.



          Anyway, you don't need the .gif extension to tell imagemagick the result should be a gif file.



          $ tmpfile=$(mktemp /tmp/pre_XXXXXX)
          $ convert rose: "gif:$tmpfile"
          $ file "$tmpfile"
          /tmp/pre_MDDsuZ: GIF image data, version 89a, 70 x 46






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 21 '13 at 18:34









          geirhageirha

          35116




          35116

























              0














              The only difference i see is, it will create temp folder in /usr/tmp/...






              share|improve this answer








              New contributor




              Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                The only difference i see is, it will create temp folder in /usr/tmp/...






                share|improve this answer








                New contributor




                Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  The only difference i see is, it will create temp folder in /usr/tmp/...






                  share|improve this answer








                  New contributor




                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  The only difference i see is, it will create temp folder in /usr/tmp/...







                  share|improve this answer








                  New contributor




                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 16 mins ago









                  Prasad VuritiPrasad Vuriti

                  1




                  1




                  New contributor




                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Prasad Vuriti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f87638%2fdifferent-behavior-of-mktemp-ubuntu-12-02-mint-9-isadora%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

                      サソリ

                      広島県道265号伴広島線

                      Accessing regular linux commands in Huawei's Dopra Linux