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;
$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?
run
$endgroup$
add a comment |
$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?
run
$endgroup$
$begingroup$
Try prepending "bash","-c" as I show in this answer.
$endgroup$
– Tim Laska
9 hours ago
add a comment |
$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?
run
$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
run
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
add a comment |
$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
add a comment |
1 Answer
1
active
oldest
votes
$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 *)
$endgroup$
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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 *)
$endgroup$
add a comment |
$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 *)
$endgroup$
add a comment |
$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 *)
$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 *)
answered 9 hours ago
Tim LaskaTim Laska
2,3781 gold badge3 silver badges13 bronze badges
2,3781 gold badge3 silver badges13 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
$begingroup$
Try prepending "bash","-c" as I show in this answer.
$endgroup$
– Tim Laska
9 hours ago