Using the pipe operator (“|”) when executing system commandsRun retrieving stdout without using RunProcessRun Does not WorkTunnel a Mathematica command through SSH

Kingdom Map and Travel Pace

How do you build a Dominant 7th chord?

My employer wants me to do a work of 6 months in just 2 months

Where does the expression "triple-A" comes from?

Can the UK veto its own extension request?

Why should I always enable compiler warnings?

Random point on a sphere

SCOTUS - Can Congress overrule Marbury v. Madison by statute?

Tracks in the snow

Evidence that matrix multiplication cannot be done in O(n^2 poly(log(n))) time

Are scroll bars dead in 2019?

Why did they ever make smaller than full-frame sensors?

Why does F + F' = 1?

Can a magnet rip protons from a nucleus?

Tall red piece with coffee cup, phone and gas picture?

Why is the T-1000 humanoid?

Using the pipe operator ("|") when executing system commands

Should I leave the first authourship of our paper to the student who did the project whereas I solved it?

How can I fix a framing mistake so I can drywall?

How does Vivi differ from other Black Mages?

Defining a function which returns a function pointer which also returns a function pointer without typedefs

How to stabilise the bicycle seatpost and saddle when it is all the way up?

My research paper filed as a patent in China by my Chinese supervisor without me as inventor

Why did it become so much more expensive to start a university?



Using the pipe operator (“|”) when executing system commands


Run retrieving stdout without using RunProcessRun Does not WorkTunnel a Mathematica command through SSH






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2












$begingroup$


I'd like to emulate



ls -tlra | grep <search term>


in Wolfram. I have tried



Module[,
SetDirectory[dir]
RunProcess[", "grep", <searchTerm>, "StandardOutput"]
]


which doesn't seem to work. Is there a way to use the "pipe" operator when shelling out commands in Wolfram?










share|improve this question









$endgroup$













  • $begingroup$
    Try prepending "bash","-c" as I show in this answer.
    $endgroup$
    – Tim Laska
    9 hours ago

















2












$begingroup$


I'd like to emulate



ls -tlra | grep <search term>


in Wolfram. I have tried



Module[,
SetDirectory[dir]
RunProcess[", "grep", <searchTerm>, "StandardOutput"]
]


which doesn't seem to work. Is there a way to use the "pipe" operator when shelling out commands in Wolfram?










share|improve this question









$endgroup$













  • $begingroup$
    Try prepending "bash","-c" as I show in this answer.
    $endgroup$
    – Tim Laska
    9 hours ago













2












2








2





$begingroup$


I'd like to emulate



ls -tlra | grep <search term>


in Wolfram. I have tried



Module[,
SetDirectory[dir]
RunProcess[", "grep", <searchTerm>, "StandardOutput"]
]


which doesn't seem to work. Is there a way to use the "pipe" operator when shelling out commands in Wolfram?










share|improve this question









$endgroup$




I'd like to emulate



ls -tlra | grep <search term>


in Wolfram. I have tried



Module[,
SetDirectory[dir]
RunProcess[", "grep", <searchTerm>, "StandardOutput"]
]


which doesn't seem to work. Is there a way to use the "pipe" operator when shelling out commands in Wolfram?







run






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 9 hours ago









GeorgeGeorge

6801 silver badge12 bronze badges




6801 silver badge12 bronze badges














  • $begingroup$
    Try prepending "bash","-c" as I show in this answer.
    $endgroup$
    – Tim Laska
    9 hours ago
















  • $begingroup$
    Try prepending "bash","-c" as I show in this answer.
    $endgroup$
    – Tim Laska
    9 hours ago















$begingroup$
Try prepending "bash","-c" as I show in this answer.
$endgroup$
– Tim Laska
9 hours ago




$begingroup$
Try prepending "bash","-c" as I show in this answer.
$endgroup$
– Tim Laska
9 hours ago










1 Answer
1






active

oldest

votes


















5














$begingroup$

For example:



RunProcess[ grep wolf ", "StandardOutput", 
ProcessDirectory -> $InstallationDirectory]
(* "-rwxr-x---+ 1 Administrators None 551360 Apr 8 09:51
wolfram.exe
-rwxr-x---+ 1 Administrators None 2390464 Apr 8 09:52
wolframscript.exe *)





share|improve this answer









$endgroup$

















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    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/4.0/"u003ecc by-sa 4.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%2fmathematica.stackexchange.com%2fquestions%2f205057%2fusing-the-pipe-operator-when-executing-system-commands%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









    5














    $begingroup$

    For example:



    RunProcess[ grep wolf ", "StandardOutput", 
    ProcessDirectory -> $InstallationDirectory]
    (* "-rwxr-x---+ 1 Administrators None 551360 Apr 8 09:51
    wolfram.exe
    -rwxr-x---+ 1 Administrators None 2390464 Apr 8 09:52
    wolframscript.exe *)





    share|improve this answer









    $endgroup$



















      5














      $begingroup$

      For example:



      RunProcess[ grep wolf ", "StandardOutput", 
      ProcessDirectory -> $InstallationDirectory]
      (* "-rwxr-x---+ 1 Administrators None 551360 Apr 8 09:51
      wolfram.exe
      -rwxr-x---+ 1 Administrators None 2390464 Apr 8 09:52
      wolframscript.exe *)





      share|improve this answer









      $endgroup$

















        5














        5










        5







        $begingroup$

        For example:



        RunProcess[ grep wolf ", "StandardOutput", 
        ProcessDirectory -> $InstallationDirectory]
        (* "-rwxr-x---+ 1 Administrators None 551360 Apr 8 09:51
        wolfram.exe
        -rwxr-x---+ 1 Administrators None 2390464 Apr 8 09:52
        wolframscript.exe *)





        share|improve this answer









        $endgroup$



        For example:



        RunProcess[ grep wolf ", "StandardOutput", 
        ProcessDirectory -> $InstallationDirectory]
        (* "-rwxr-x---+ 1 Administrators None 551360 Apr 8 09:51
        wolfram.exe
        -rwxr-x---+ 1 Administrators None 2390464 Apr 8 09:52
        wolframscript.exe *)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 9 hours ago









        Tim LaskaTim Laska

        2,3781 gold badge3 silver badges13 bronze badges




        2,3781 gold badge3 silver badges13 bronze badges































            draft saved

            draft discarded















































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

            Use MathJax to format equations. MathJax reference.


            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%2fmathematica.stackexchange.com%2fquestions%2f205057%2fusing-the-pipe-operator-when-executing-system-commands%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

            ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

            Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу