Using pipes in arara command?











up vote
0
down vote

favorite












I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).



This is my first attempt:



!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:


When I try to use it, however, I get this:



cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE


So it seems like the pipe character and the pdflatex command are being passed as arguments to cat, instead of the cat output being redirected to pdflatex (as when I run something like cat preamble.tex file.tex | pdflatex from the command line, for instance).



So is there a way to make the command redirection work with arara?










share|improve this question
















bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1




    You can always put it in a script and run the script.
    – cfr
    May 31 at 23:51










  • @cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
    – dbmrq
    Jun 1 at 0:35






  • 4




    The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
    – Sean Allred
    Jun 1 at 1:26












  • @SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
    – dbmrq
    Jun 1 at 4:58















up vote
0
down vote

favorite












I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).



This is my first attempt:



!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:


When I try to use it, however, I get this:



cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE


So it seems like the pipe character and the pdflatex command are being passed as arguments to cat, instead of the cat output being redirected to pdflatex (as when I run something like cat preamble.tex file.tex | pdflatex from the command line, for instance).



So is there a way to make the command redirection work with arara?










share|improve this question
















bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1




    You can always put it in a script and run the script.
    – cfr
    May 31 at 23:51










  • @cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
    – dbmrq
    Jun 1 at 0:35






  • 4




    The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
    – Sean Allred
    Jun 1 at 1:26












  • @SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
    – dbmrq
    Jun 1 at 4:58













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).



This is my first attempt:



!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:


When I try to use it, however, I get this:



cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE


So it seems like the pipe character and the pdflatex command are being passed as arguments to cat, instead of the cat output being redirected to pdflatex (as when I run something like cat preamble.tex file.tex | pdflatex from the command line, for instance).



So is there a way to make the command redirection work with arara?










share|improve this question















I've just started using arara and I'm trying to write a custom rule that would allow me to compile documents without a preamble (by using a separate preamble template).



This is my first attempt:



!config
identifier: myrule
name: MyRule
commands:
- cat preamble.tex "@{file}" | pdflatex
arguments:


When I try to use it, however, I get this:



cat: |: No such file or directory
cat: pdflatex: No such file or directory
FAILURE


So it seems like the pipe character and the pdflatex command are being passed as arguments to cat, instead of the cat output being redirected to pdflatex (as when I run something like cat preamble.tex file.tex | pdflatex from the command line, for instance).



So is there a way to make the command redirection work with arara?







arara






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 1 at 4:59

























asked May 31 at 23:05









dbmrq

554213




554213





bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1




    You can always put it in a script and run the script.
    – cfr
    May 31 at 23:51










  • @cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
    – dbmrq
    Jun 1 at 0:35






  • 4




    The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
    – Sean Allred
    Jun 1 at 1:26












  • @SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
    – dbmrq
    Jun 1 at 4:58














  • 1




    You can always put it in a script and run the script.
    – cfr
    May 31 at 23:51










  • @cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
    – dbmrq
    Jun 1 at 0:35






  • 4




    The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
    – Sean Allred
    Jun 1 at 1:26












  • @SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
    – dbmrq
    Jun 1 at 4:58








1




1




You can always put it in a script and run the script.
– cfr
May 31 at 23:51




You can always put it in a script and run the script.
– cfr
May 31 at 23:51












@cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35




@cfr Ah, I should have thought of that, haha. 🤦🏻‍♂️ It works, thanks! I'm still curious if it's possible to do it directly in the rule, though, in case anybody has any insights on that...
– dbmrq
Jun 1 at 0:35




4




4




The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26






The reason this would be difficult to have in the YAML file itself is because piping is a shell feature and arara starts processes. To get a pipe, arara would have to start a shell and feed the command to the shell instead, which is not really something we'd get for free from the JVM (AFAIK) and would introduce an external dependency on something that could change from system-to-system. That's my guess – I'll let Paulo or one of the others on that team speak definitively on the matter :-)
– Sean Allred
Jun 1 at 1:26














@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58




@SeanAllred Ah, I see. I thought the commands were sent to a shell anyway. That makes sense, thank you for the explanation. :)
– dbmrq
Jun 1 at 4:58










1 Answer
1






active

oldest

votes

















up vote
0
down vote













This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:



https://github.com/dbmrq/solo



There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:



!config
identifier: solo
name: Solo
command:
- solo "@{file}"
arguments:





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    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',
    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%2ftex.stackexchange.com%2fquestions%2f434410%2fusing-pipes-in-arara-command%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:



    https://github.com/dbmrq/solo



    There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:



    !config
    identifier: solo
    name: Solo
    command:
    - solo "@{file}"
    arguments:





    share|improve this answer

























      up vote
      0
      down vote













      This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:



      https://github.com/dbmrq/solo



      There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:



      !config
      identifier: solo
      name: Solo
      command:
      - solo "@{file}"
      arguments:





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:



        https://github.com/dbmrq/solo



        There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:



        !config
        identifier: solo
        name: Solo
        command:
        - solo "@{file}"
        arguments:





        share|improve this answer












        This isn't really an answer to my question about arara, but I followed @cfr's suggestion and wrote a script to compile those files for me and it's working pretty well, so I thought I'd share it in case someone else is interested:



        https://github.com/dbmrq/solo



        There's probably no point, since the script itself already handles many use cases, but it's also easy to use it in an arara rule:



        !config
        identifier: solo
        name: Solo
        command:
        - solo "@{file}"
        arguments:






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 2 at 22:45









        dbmrq

        554213




        554213






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2ftex.stackexchange.com%2fquestions%2f434410%2fusing-pipes-in-arara-command%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

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks