# Compile and run from command prompt

**URL:** <https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799>\
**Category:** ROOT\
**Created:** [February 16, 2012, 1:42pm UTC](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799 "2012-02-16T13:42:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [February 16, 2012, 3:19pm UTC](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799/2 "2012-02-16T15:19:16Z")

</div>

A brutal fix …

```auto
echo 'gROOT->LoadMacro("macro.C"); macro m; m.Loop(); gSystem->Exit(0);' | root -b -l

```

… or …

```auto
root -b -l <<EOF
.L macro.C
macro m;
m.Loop();
.q
EOF

```

---

_[View the full topic](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799)._
